22// / \author Diffblue Ltd.
33// / Unit tests for checking the piped process communication mechanism.
44
5- # include < testing-utils/use_catch.h>
6- # include < util/optional.h>
7- # include < util/piped_process.h>
8- # include < util/string_utils.h>
5+ #include < util/optional.h>
6+ #include < util/piped_process.h>
7+ #include < util/string_utils.h>
8+
9+ #include < testing-utils/message.h>
10+ #include < testing-utils/use_catch.h>
11+
912// Used for testing destructor/timing
1013#include < chrono>
1114
@@ -22,7 +25,7 @@ TEST_CASE(
2225 commands.push_back (" /bin/echo" );
2326 commands.push_back (to_be_echoed);
2427#endif
25- piped_processt process (commands);
28+ piped_processt process (commands, null_message_handler );
2629
2730 // This is an indirect way to detect when the pipe has something. This
2831 // could (in theory) also return when there is an error, but this unit
@@ -45,7 +48,7 @@ TEST_CASE(
4548 const std::string expected_error (" Launching abcde failed" );
4649 commands.push_back (" abcde" );
4750#endif
48- piped_processt process (commands);
51+ piped_processt process (commands, null_message_handler );
4952
5053 // This is an indirect way to detect when the pipe has something. This
5154 // could (in theory) also return when there is an error, but this unit
@@ -81,7 +84,7 @@ TEST_CASE(
8184 std::chrono::steady_clock::now ();
8285 {
8386 // Scope restriction to cause destruction
84- piped_processt process (commands);
87+ piped_processt process (commands, null_message_handler );
8588 }
8689 std::chrono::steady_clock::time_point end_time =
8790 std::chrono::steady_clock::now ();
@@ -95,7 +98,7 @@ TEST_CASE(
9598# if 0
9699 commands.push_back (" sleep 6" );
97100 time_t calc = time (NULL );
98- piped_processt process (commands);
101+ piped_processt process (commands, null_message_handler );
99102 process.~piped_processt ();
100103 calc = time (NULL ) - calc;
101104# else
@@ -114,7 +117,7 @@ TEST_CASE(
114117 std::vector<std::string> commands;
115118 commands.push_back (" z3" );
116119 commands.push_back (" -in" );
117- piped_processt process (commands);
120+ piped_processt process (commands, null_message_handler );
118121
119122 REQUIRE (
120123 process.send (" (echo \" hi\" )\n " ) ==
@@ -136,7 +139,7 @@ TEST_CASE(
136139 commands.push_back (" z3" );
137140 commands.push_back (" -in" );
138141 const std::string termination_statement = " (exit)\n " ;
139- piped_processt process (commands);
142+ piped_processt process (commands, null_message_handler );
140143
141144 REQUIRE (
142145 process.send (" (echo \" hi\" )\n " ) ==
@@ -166,7 +169,7 @@ TEST_CASE(
166169 commands.push_back (" z3" );
167170 commands.push_back (" -in" );
168171 commands.push_back (" -smt2" );
169- piped_processt process (commands);
172+ piped_processt process (commands, null_message_handler );
170173
171174 std::string message =
172175 " (set-logic QF_LIA) (declare-const x Int) (declare-const y Int) (assert (> "
@@ -190,7 +193,7 @@ TEST_CASE(
190193 commands.push_back (" z3" );
191194 commands.push_back (" -in" );
192195 commands.push_back (" -smt2" );
193- piped_processt process (commands);
196+ piped_processt process (commands, null_message_handler );
194197
195198 std::string statement =
196199 " (set-logic QF_LIA) (declare-const x Int) (declare-const y Int) (assert (> "
@@ -212,7 +215,7 @@ TEST_CASE(
212215 std::vector<std::string> commands;
213216 commands.push_back (" z3" );
214217 commands.push_back (" -in" );
215- piped_processt process (commands);
218+ piped_processt process (commands, null_message_handler );
216219
217220 REQUIRE (
218221 process.send (" (echo \" hi\" )\n " ) ==
@@ -242,7 +245,7 @@ TEST_CASE(
242245 commands.push_back (" z3" );
243246 commands.push_back (" -in" );
244247 commands.push_back (" -smt2" );
245- piped_processt process (commands);
248+ piped_processt process (commands, null_message_handler );
246249
247250 std::string statement =
248251 " (set-logic QF_LIA) (declare-const x Int) (declare-const y Int) (assert (> "
@@ -298,7 +301,7 @@ TEST_CASE(
298301 commands.push_back (" z3" );
299302 commands.push_back (" -in" );
300303 commands.push_back (" -smt2" );
301- piped_processt process (commands);
304+ piped_processt process (commands, null_message_handler );
302305
303306 std::string statement =
304307 " (set-logic QF_LIA) (declare-const x Int) (declare-const y Int) (assert (> "
0 commit comments