2
2
// / \author Diffblue Ltd.
3
3
// / Unit tests for checking the piped process communication mechanism.
4
4
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
+
9
12
// Used for testing destructor/timing
10
13
#include < chrono>
11
14
@@ -22,7 +25,7 @@ TEST_CASE(
22
25
commands.push_back (" /bin/echo" );
23
26
commands.push_back (to_be_echoed);
24
27
#endif
25
- piped_processt process (commands);
28
+ piped_processt process (commands, null_message_handler );
26
29
27
30
// This is an indirect way to detect when the pipe has something. This
28
31
// could (in theory) also return when there is an error, but this unit
@@ -45,7 +48,7 @@ TEST_CASE(
45
48
const std::string expected_error (" Launching abcde failed" );
46
49
commands.push_back (" abcde" );
47
50
#endif
48
- piped_processt process (commands);
51
+ piped_processt process (commands, null_message_handler );
49
52
50
53
// This is an indirect way to detect when the pipe has something. This
51
54
// could (in theory) also return when there is an error, but this unit
@@ -114,7 +117,7 @@ TEST_CASE(
114
117
std::vector<std::string> commands;
115
118
commands.push_back (" z3" );
116
119
commands.push_back (" -in" );
117
- piped_processt process (commands);
120
+ piped_processt process (commands, null_message_handler );
118
121
119
122
REQUIRE (
120
123
process.send (" (echo \" hi\" )\n " ) ==
@@ -136,7 +139,7 @@ TEST_CASE(
136
139
commands.push_back (" z3" );
137
140
commands.push_back (" -in" );
138
141
const std::string termination_statement = " (exit)\n " ;
139
- piped_processt process (commands);
142
+ piped_processt process (commands, null_message_handler );
140
143
141
144
REQUIRE (
142
145
process.send (" (echo \" hi\" )\n " ) ==
@@ -166,7 +169,7 @@ TEST_CASE(
166
169
commands.push_back (" z3" );
167
170
commands.push_back (" -in" );
168
171
commands.push_back (" -smt2" );
169
- piped_processt process (commands);
172
+ piped_processt process (commands, null_message_handler );
170
173
171
174
std::string message =
172
175
" (set-logic QF_LIA) (declare-const x Int) (declare-const y Int) (assert (> "
@@ -190,7 +193,7 @@ TEST_CASE(
190
193
commands.push_back (" z3" );
191
194
commands.push_back (" -in" );
192
195
commands.push_back (" -smt2" );
193
- piped_processt process (commands);
196
+ piped_processt process (commands, null_message_handler );
194
197
195
198
std::string statement =
196
199
" (set-logic QF_LIA) (declare-const x Int) (declare-const y Int) (assert (> "
@@ -212,7 +215,7 @@ TEST_CASE(
212
215
std::vector<std::string> commands;
213
216
commands.push_back (" z3" );
214
217
commands.push_back (" -in" );
215
- piped_processt process (commands);
218
+ piped_processt process (commands, null_message_handler );
216
219
217
220
REQUIRE (
218
221
process.send (" (echo \" hi\" )\n " ) ==
@@ -242,7 +245,7 @@ TEST_CASE(
242
245
commands.push_back (" z3" );
243
246
commands.push_back (" -in" );
244
247
commands.push_back (" -smt2" );
245
- piped_processt process (commands);
248
+ piped_processt process (commands, null_message_handler );
246
249
247
250
std::string statement =
248
251
" (set-logic QF_LIA) (declare-const x Int) (declare-const y Int) (assert (> "
@@ -298,7 +301,7 @@ TEST_CASE(
298
301
commands.push_back (" z3" );
299
302
commands.push_back (" -in" );
300
303
commands.push_back (" -smt2" );
301
- piped_processt process (commands);
304
+ piped_processt process (commands, null_message_handler );
302
305
303
306
std::string statement =
304
307
" (set-logic QF_LIA) (declare-const x Int) (declare-const y Int) (assert (> "
0 commit comments