aboutsummaryrefslogtreecommitdiff
path: root/build2/test/script/script.cxx
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.cxx
parent658731ac32fa2e06a9f2b1a8cfffc65090f9373e (diff)
Move exit status to command, make runner run commands, not tests
Diffstat (limited to 'build2/test/script/script.cxx')
-rw-r--r--build2/test/script/script.cxx31
1 files changed, 11 insertions, 20 deletions
diff --git a/build2/test/script/script.cxx b/build2/test/script/script.cxx
index 5e79cab..5931d3f 100644
--- a/build2/test/script/script.cxx
+++ b/build2/test/script/script.cxx
@@ -79,6 +79,17 @@ namespace build2
if (c.in.type != redirect_type::none) print_redirect (c.in, "<");
if (c.out.type != redirect_type::none) print_redirect (c.out, ">");
if (c.err.type != redirect_type::none) print_redirect (c.err, "2>");
+
+ if (c.exit.comparison != exit_comparison::eq || c.exit.status != 0)
+ {
+ switch (c.exit.comparison)
+ {
+ case exit_comparison::eq: o << " == "; break;
+ case exit_comparison::ne: o << " != "; break;
+ }
+
+ o << static_cast<uint16_t> (c.exit.status);
+ }
}
if ((m & command_to_stream::here_doc) == command_to_stream::here_doc)
@@ -91,26 +102,6 @@ namespace build2
}
}
- ostream&
- operator<< (ostream& o, const test& t)
- {
- to_stream (o, t, command_to_stream::header);
-
- if (t.exit.comparison != exit_comparison::eq || t.exit.status != 0)
- {
- switch (t.exit.comparison)
- {
- case exit_comparison::eq: o << " == "; break;
- case exit_comparison::ne: o << " != "; break;
- }
-
- o << static_cast<uint16_t> (t.exit.status);
- }
-
- to_stream (o, t, command_to_stream::here_doc);
- return o;
- }
-
script::
script (target& tt, testscript& st)
: test_target (tt), script_target (st),