aboutsummaryrefslogtreecommitdiff
path: root/build2/test/script/runner.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2017-02-03 19:56:11 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2017-02-03 23:57:33 +0300
commit2c1aff8bf09a50189c3d0b2ff86ab057ca009749 (patch)
treedf20195c6833c4bb9eec8521c0f055393e65543f /build2/test/script/runner.cxx
parent044e2e1c1460fb060f677a366144b98905522754 (diff)
Fix runner output in verbose (-v, -V) modes
Diffstat (limited to 'build2/test/script/runner.cxx')
-rw-r--r--build2/test/script/runner.cxx30
1 files changed, 21 insertions, 9 deletions
diff --git a/build2/test/script/runner.cxx b/build2/test/script/runner.cxx
index 751daec..4047b5a 100644
--- a/build2/test/script/runner.cxx
+++ b/build2/test/script/runner.cxx
@@ -761,9 +761,6 @@ namespace build2
//
const command& c (*bc);
- if (verb >= 3)
- text << c;
-
// Register the command explicit cleanups. Verify that the path being
// cleaned up is a sub-path of the testscript working directory. Fail
// if this is not the case.
@@ -1100,10 +1097,24 @@ namespace build2
bool success;
+ auto process_args = [&c] () -> cstrings
+ {
+ cstrings args {c.program.string ().c_str ()};
+
+ for (const auto& a: c.arguments)
+ args.push_back (a.c_str ());
+
+ args.push_back (nullptr);
+ return args;
+ };
+
if (b != nullptr)
{
// Execute the builtin.
//
+ if (verb >= 2)
+ print_process (process_args ());
+
try
{
future<uint8_t> f (
@@ -1123,12 +1134,7 @@ namespace build2
{
// Execute the process.
//
- cstrings args {c.program.string ().c_str ()};
-
- for (const auto& a: c.arguments)
- args.push_back (a.c_str ());
-
- args.push_back (nullptr);
+ cstrings args (process_args ());
try
{
@@ -1307,6 +1313,9 @@ namespace build2
void default_runner::
run (scope& sp, const command_expr& expr, size_t li, const location& ll)
{
+ if (verb >= 3)
+ text << expr;
+
if (!run_expr (sp, expr, li, ll, true))
throw failed (); // Assume diagnostics is already printed.
}
@@ -1316,6 +1325,9 @@ namespace build2
const command_expr& expr,
size_t li, const location& ll)
{
+ if (verb >= 3)
+ text << "? " << expr;
+
return run_expr (sp, expr, li, ll, false);
}
}