diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2017-04-26 16:00:48 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2017-04-26 16:00:48 +0200 |
commit | f3ffef62fa5079a19cb3347837521495bdbe79c4 (patch) | |
tree | 34d1491c213326be0bee77ad48b342b2ec3354fa | |
parent | 8276cb927bafd338be237adbecf437e70042da99 (diff) |
Cleanup error messages
-rw-r--r-- | build2/test/rule.cxx | 8 | ||||
-rw-r--r-- | build2/test/script/runner.cxx | 20 |
2 files changed, 13 insertions, 15 deletions
diff --git a/build2/test/rule.cxx b/build2/test/rule.cxx index 7148fc0..91a6806 100644 --- a/build2/test/rule.cxx +++ b/build2/test/rule.cxx @@ -636,18 +636,18 @@ namespace build2 if (!pe.normal ()) { - dr << error << "terminated abnormally: "; + dr << error; print_process (dr, args); + dr << " terminated abnormally: " << pe.description (); - dr << info << pe.description (); if (pe.core ()) dr << " (core dumped)"; } else { - dr << error << "exit status " << static_cast<uint16_t> (pe.code ()) - << ": "; + dr << error; print_process (dr, args); + dr << " exited with code " << static_cast<uint16_t> (pe.code ()); } } diff --git a/build2/test/script/runner.cxx b/build2/test/script/runner.cxx index e01f621..5107144 100644 --- a/build2/test/script/runner.cxx +++ b/build2/test/script/runner.cxx @@ -337,28 +337,26 @@ namespace build2 assert (p.exit); const process_exit& pe (*p.exit); - // Note that both POSIX and GNU diff utilities report error - // exiting with the code > 1. + // Note that both POSIX and GNU diff report error by exiting with + // the code > 1. // if (!pe.normal () || pe.code () > 1) { - diag_record d (fail (ll)); + diag_record dr (fail (ll)); if (!pe.normal ()) { - d << pp << " terminated abnormally: "; - print_process (d, args); + print_process (dr, args); + dr << " terminated abnormally: " << pe.description (); - d << info << pe.description (); if (pe.core ()) - d << " (core dumped)"; + dr << " (core dumped)"; } else { - d << pp << " exit status " - << static_cast<uint16_t> (pe.code ()) << ": "; - - print_process (d, args); + print_process (dr, args); + dr << " exited with code " + << static_cast<uint16_t> (pe.code ()); } } |