aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build2/test/script/runner.cxx15
-rw-r--r--build2/test/script/script.cxx17
-rw-r--r--build2/test/script/script.hxx3
-rw-r--r--unit-tests/test/script/parser/driver.cxx11
4 files changed, 23 insertions, 23 deletions
diff --git a/build2/test/script/runner.cxx b/build2/test/script/runner.cxx
index 7fffe31..000b605 100644
--- a/build2/test/script/runner.cxx
+++ b/build2/test/script/runner.cxx
@@ -1785,7 +1785,18 @@ namespace build2
return;
if (verb >= 3)
- text << "$ " << ct << expr;
+ {
+ char c ('\0');
+
+ switch (ct)
+ {
+ case command_type::test: c = ' '; break;
+ case command_type::setup: c = '+'; break;
+ case command_type::teardown: c = '-'; break;
+ }
+
+ text << ": " << c << expr;
+ }
if (!run_expr (sp, expr, li, ll, true))
throw failed (); // Assume diagnostics is already printed.
@@ -1797,7 +1808,7 @@ namespace build2
size_t li, const location& ll)
{
if (verb >= 3)
- text << "? " << expr;
+ text << ": ?" << expr;
return run_expr (sp, expr, li, ll, false);
}
diff --git a/build2/test/script/script.cxx b/build2/test/script/script.cxx
index 0516b0f..77b5e68 100644
--- a/build2/test/script/script.cxx
+++ b/build2/test/script/script.cxx
@@ -305,23 +305,6 @@ namespace build2
}
}
- // command_type
- //
- ostream&
- operator<< (ostream& o, command_type ct)
- {
- const char* s (nullptr);
-
- switch (ct)
- {
- case command_type::test: s = ""; break;
- case command_type::setup: s = "+"; break;
- case command_type::teardown: s = "-"; break;
- }
-
- return o << s;
- }
-
// redirect
//
redirect::
diff --git a/build2/test/script/script.hxx b/build2/test/script/script.hxx
index c511f01..e4db856 100644
--- a/build2/test/script/script.hxx
+++ b/build2/test/script/script.hxx
@@ -318,9 +318,6 @@ namespace build2
//
enum class command_type {test, setup, teardown};
- ostream&
- operator<< (ostream&, command_type);
-
// description
//
struct description
diff --git a/unit-tests/test/script/parser/driver.cxx b/unit-tests/test/script/parser/driver.cxx
index fceb477..f6c8f7f 100644
--- a/unit-tests/test/script/parser/driver.cxx
+++ b/unit-tests/test/script/parser/driver.cxx
@@ -94,7 +94,16 @@ namespace build2
size_t i,
const location&) override
{
- cout << ind_ << t << e;
+ const char* s (nullptr);
+
+ switch (t)
+ {
+ case command_type::test: s = ""; break;
+ case command_type::setup: s = "+"; break;
+ case command_type::teardown: s = "-"; break;
+ }
+
+ cout << ind_ << s << e;
if (line_)
cout << " # " << i;