aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/notmuch-test
diff options
context:
space:
mode:
authorGravatar Austin Clements <amdragon@MIT.EDU>2012-11-27 23:13:16 -0500
committerGravatar David Bremner <bremner@debian.org>2012-11-29 09:24:12 -0400
commitec59896de06cf76d6d7ee6ff7bc46df522c7afe3 (patch)
tree3d4cbe54092085acf6698fdc50a05e1fedad2e2b /test/notmuch-test
parentd59d9c81522d9127dde089ae9457f44de53f28e9 (diff)
test: Abort driver if a test script aborts
Previously, if a test script aborted (e.g., because it passed too few arguments to a test function), the test driver loop would simply continue on to the next test script and the final results would declare that everything passed (except that the test count would look suspiciously low, but maybe you just misremembered how many tests there were). Now, if a test script exits with a non-zero status and did not produce a final results file, we propagate that failure out of the driver loop immediately. To keep this simple, this patch removes the PID from the test-results file name. This PID was inherited from the git test system and seems unnecessary, since the file name already includes the name of the test script and the test-results directory is created anew for each run.
Diffstat (limited to 'test/notmuch-test')
-rwxr-xr-xtest/notmuch-test6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/notmuch-test b/test/notmuch-test
index 9a1b3758..f2754398 100755
--- a/test/notmuch-test
+++ b/test/notmuch-test
@@ -81,6 +81,12 @@ trap 'e=$?; kill $!; exit $e' HUP INT TERM
for test in $TESTS; do
$TEST_TIMEOUT_CMD ./$test "$@" &
wait $!
+ # If the test failed without producing results, then it aborted,
+ # so we should abort, too.
+ RES=$?
+ if [[ $RES != 0 && ! -e "test-results/${test%.sh}" ]]; then
+ exit $RES
+ fi
done
trap - HUP INT TERM