summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorStefano Lattarini <stefano.lattarini@gmail.com>2013-12-24 17:45:18 +0100
committerStefano Lattarini <stefano.lattarini@gmail.com>2013-12-24 22:14:51 +0100
commitc7e2fb2e73b2d1b904feef0ed5e87ce05a41c119 (patch)
tree0f2cf9fa68987c5a74231a3e8c630c62163384f4 /lib
parent526c4b04a699fd62da6bc3915cdb333f0a6ca92d (diff)
downloadautomake-c7e2fb2e73b2d1b904feef0ed5e87ce05a41c119.tar.gz
testsuite harness: report test exit status in log file
The exit status of a test should be reported in the test logs, so that one can see at a glance whether the test has succeeded or failed, without having to look also into the corresponding .trs file. This fixes automake bug#11814. * lib/test-driver: Also report the test script exit status in the test log (as the last line). * t/check-exit-status-reported.sh: Test this new behaviour. * t/list-of-tests.mk: Add the new test. * t/ax/test-lib.sh( am_exit_trap): No longer log the test exit status; this has been made redundant by the change to 'test-driver'. While at it, fix an imperfect quoting. Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Diffstat (limited to 'lib')
-rwxr-xr-xlib/test-driver13
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/test-driver b/lib/test-driver
index d30605660..110eec409 100755
--- a/lib/test-driver
+++ b/lib/test-driver
@@ -106,11 +106,14 @@ trap "st=143; $do_exit" 15
# Test script is run here.
"$@" >$log_file 2>&1
estatus=$?
+
if test $enable_hard_errors = no && test $estatus -eq 99; then
- estatus=1
+ tweaked_estatus=1
+else
+ tweaked_estatus=$estatus
fi
-case $estatus:$expect_failure in
+case $tweaked_estatus:$expect_failure in
0:yes) col=$red res=XPASS recheck=yes gcopy=yes;;
0:*) col=$grn res=PASS recheck=no gcopy=no;;
77:*) col=$blu res=SKIP recheck=no gcopy=yes;;
@@ -119,6 +122,12 @@ case $estatus:$expect_failure in
*:*) col=$red res=FAIL recheck=yes gcopy=yes;;
esac
+# Report the test outcome and exit status in the logs, so that one can
+# know whether the test passed or failed simply by looking at the '.log'
+# file, without the need of also peaking into the corresponding '.trs'
+# file (automake bug#11814).
+echo "$res $test_name (exit status: $estatus)" >>$log_file
+
# Report outcome to console.
echo "${col}${res}${std}: $test_name"