aboutsummaryrefslogtreecommitdiff
path: root/build2
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2017-04-26 18:02:27 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2017-04-26 18:02:27 +0300
commit530e19cc8f53f066039967c41bb432111ce98626 (patch)
treef5a2910540a8f32c1f47aef61c99d72882b4cc0d /build2
parent671e580555d94dc95309e5e4f86e27d05189530e (diff)
Diagnostics printing minor optimization
Diffstat (limited to 'build2')
-rw-r--r--build2/test/rule.cxx9
-rw-r--r--build2/test/script/runner.cxx15
2 files changed, 9 insertions, 15 deletions
diff --git a/build2/test/rule.cxx b/build2/test/rule.cxx
index 91a6806..171cbac 100644
--- a/build2/test/rule.cxx
+++ b/build2/test/rule.cxx
@@ -634,21 +634,18 @@ namespace build2
if (pr) // First failure?
dr << fail << "test " << t << " failed"; // Multi test: test 1.
+ dr << error;
+ print_process (dr, args);
+
if (!pe.normal ())
{
- dr << error;
- print_process (dr, args);
dr << " terminated abnormally: " << pe.description ();
if (pe.core ())
dr << " (core dumped)";
}
else
- {
- dr << error;
- print_process (dr, args);
dr << " exited with code " << static_cast<uint16_t> (pe.code ());
- }
}
return pr && wr;
diff --git a/build2/test/script/runner.cxx b/build2/test/script/runner.cxx
index 5107144..105039a 100644
--- a/build2/test/script/runner.cxx
+++ b/build2/test/script/runner.cxx
@@ -342,22 +342,19 @@ namespace build2
//
if (!pe.normal () || pe.code () > 1)
{
- diag_record dr (fail (ll));
+ diag_record d (fail (ll));
+ print_process (d, args);
if (!pe.normal ())
{
- print_process (dr, args);
- dr << " terminated abnormally: " << pe.description ();
+ d << " terminated abnormally: " << pe.description ();
if (pe.core ())
- dr << " (core dumped)";
+ d << " (core dumped)";
}
else
- {
- print_process (dr, args);
- dr << " exited with code "
- << static_cast<uint16_t> (pe.code ());
- }
+ d << " exited with code "
+ << static_cast<uint16_t> (pe.code ());
}
// Output doesn't match the expected result.