aboutsummaryrefslogtreecommitdiff
path: root/test/notmuch-test
diff options
context:
space:
mode:
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>2019-05-26 11:03:13 -0400
committerDavid Bremner <david@tethera.net>2019-05-26 18:55:06 -0300
commit73cebe6e7233f59ba26d9f7c05265b7776795818 (patch)
tree3a6fe85fcf12364a89b811e5e2531904edd39185 /test/notmuch-test
parent86b657d014c500a04e442ee756687753564bbead (diff)
test: report summary even when aborting
In certain cases of test suite failure, the summary report was not being printed. In particular, any failure on the parallel test suite, and any aborted test in the serialized test suite would end up hiding the summary. It's better to always show the summary where we can (while preserving the return code). If we do abort due to this high-level failure, though, we should also announce to the user that we're doing so as close to the end of the process as possible, to make it easier to find the problem. Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Diffstat (limited to 'test/notmuch-test')
-rwxr-xr-xtest/notmuch-test14
1 files changed, 11 insertions, 3 deletions
diff --git a/test/notmuch-test b/test/notmuch-test
index 50ed8721..b58fd3b3 100755
--- a/test/notmuch-test
+++ b/test/notmuch-test
@@ -45,6 +45,8 @@ else
fi
trap 'e=$?; kill $!; exit $e' HUP INT TERM
+
+META_FAILURE=
# Run the tests
if test -z "$NOTMUCH_TEST_SERIALIZE" && command -v parallel >/dev/null ; then
test -t 1 && export COLORS_WITHOUT_TTY=t || :
@@ -57,8 +59,7 @@ if test -z "$NOTMUCH_TEST_SERIALIZE" && command -v parallel >/dev/null ; then
fi
RES=$?
if [[ $RES != 0 ]]; then
- echo "parallel test suite returned error code $RES"
- exit $RES
+ META_FAILURE="parallel test suite returned error code $RES"
fi
else
for test in $TESTS; do
@@ -69,7 +70,8 @@ else
RES=$?
testname=$(basename $test .sh)
if [[ $RES != 0 && ! -e "$NOTMUCH_BUILDDIR/test/test-results/$testname" ]]; then
- exit $RES
+ META_FAILURE="Aborting on $testname (returned $RES)"
+ break
fi
done
fi
@@ -79,6 +81,12 @@ trap - HUP INT TERM
echo
$NOTMUCH_SRCDIR/test/aggregate-results.sh $NOTMUCH_BUILDDIR/test/test-results/*
ev=$?
+if [ -n "$META_FAILURE" ]; then
+ printf 'ERROR: %s\n' "$META_FAILURE"
+ if [ $ev = 0 ]; then
+ ev=$RES
+ fi
+fi
# Clean up
rm -rf $NOTMUCH_BUILDDIR/test/test-results