From d7c4a08efd25ac11d5931a3bd2c50fbe717faa8b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 21 Oct 2016 10:11:57 +0200 Subject: Move exit status to command, make runner run commands, not tests --- build2/test/script/script.cxx | 31 +++++++++++-------------------- 1 file changed, 11 insertions(+), 20 deletions(-) (limited to 'build2/test/script/script.cxx') 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 (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 (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), -- cgit v1.1