aboutsummaryrefslogtreecommitdiff
path: root/build2/test/script/script
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-10-21 10:11:57 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-11-04 09:26:34 +0200
commitd7c4a08efd25ac11d5931a3bd2c50fbe717faa8b (patch)
treea2dcbbbd10aa5ca47c80b17015eecfa7add00fb8 /build2/test/script/script
parent658731ac32fa2e06a9f2b1a8cfffc65090f9373e (diff)
Move exit status to command, make runner run commands, not tests
Diffstat (limited to 'build2/test/script/script')
-rw-r--r--build2/test/script/script46
1 files changed, 21 insertions, 25 deletions
diff --git a/build2/test/script/script b/build2/test/script/script
index e563363..a847e2b 100644
--- a/build2/test/script/script
+++ b/build2/test/script/script
@@ -49,29 +49,6 @@ namespace build2
string here_end; // Only for here-documents.
};
- struct command
- {
- path program;
- strings arguments;
-
- redirect in;
- redirect out;
- redirect err;
- };
-
- enum class command_to_stream: uint16_t
- {
- header = 0x01,
- here_doc = 0x02, // Note: printed on a new line.
- all = header | here_doc
- };
-
- void
- to_stream (ostream&, const command&, command_to_stream);
-
- ostream&
- operator<< (ostream&, const command&);
-
enum class exit_comparison {eq, ne};
struct command_exit
@@ -99,13 +76,32 @@ namespace build2
uint8_t status;
};
- struct test: command
+ struct command
{
+ path program;
+ strings arguments;
+
+ redirect in;
+ redirect out;
+ redirect err;
+
command_exit exit {exit_comparison::eq, 0};
};
+ enum class command_to_stream: uint16_t
+ {
+ header = 0x01,
+ here_doc = 0x02, // Note: printed on a new line.
+ all = header | here_doc
+ };
+
+ void
+ to_stream (ostream&, const command&, command_to_stream);
+
ostream&
- operator<< (ostream&, const test&);
+ operator<< (ostream&, const command&);
+
+ struct test: command {};
class scope
{