aboutsummaryrefslogtreecommitdiff
path: root/build2/test
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-12-17 08:53:02 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-12-17 08:53:02 +0200
commit8065636673e85704f5aab3ce3674dea729cd2a86 (patch)
tree12ac57f7186a13eb0ce99a4e92ac9b3a8c645d86 /build2/test
parent733aa97b5c0024a7856df7a571b542742f0f3e65 (diff)
Trace non-zero process exit code
Also convert to using operator<<(ostream,process_exit).
Diffstat (limited to 'build2/test')
-rw-r--r--build2/test/rule.cxx11
-rw-r--r--build2/test/script/runner.cxx19
2 files changed, 3 insertions, 27 deletions
diff --git a/build2/test/rule.cxx b/build2/test/rule.cxx
index 869c23b..96941e6 100644
--- a/build2/test/rule.cxx
+++ b/build2/test/rule.cxx
@@ -639,16 +639,7 @@ namespace build2
dr << error;
print_process (dr, args);
-
- if (!pe.normal ())
- {
- dr << " terminated abnormally: " << pe.description ();
-
- if (pe.core ())
- dr << " (core dumped)";
- }
- else
- dr << " exited with code " << static_cast<uint16_t> (pe.code ());
+ dr << " " << pe;
}
return pr && wr;
diff --git a/build2/test/script/runner.cxx b/build2/test/script/runner.cxx
index 2377774..cddd3a7 100644
--- a/build2/test/script/runner.cxx
+++ b/build2/test/script/runner.cxx
@@ -344,17 +344,7 @@ namespace build2
{
diag_record d (fail (ll));
print_process (d, args);
-
- if (!pe.normal ())
- {
- d << " terminated abnormally: " << pe.description ();
-
- if (pe.core ())
- d << " (core dumped)";
- }
- else
- d << " exited with code "
- << static_cast<uint16_t> (pe.code ());
+ d << " " << pe;
}
// Output doesn't match the expected result.
@@ -1683,12 +1673,7 @@ namespace build2
diag_record d (valid ? error (ll) : fail (ll));
if (!exit->normal ())
- {
- d << pr << " terminated abnormally: " << exit->description ();
-
- if (exit->core ())
- d << " (core dumped)";
- }
+ d << pr << " " << *exit;
else
{
uint16_t ec (exit->code ()); // Make sure is printed as integer.