]> git.notmuchmail.org Git - notmuch/commitdiff
test: make all tests terminable with Ctrl-c
authorTomi Ollila <tomi.ollila@iki.fi>
Tue, 8 Nov 2011 16:02:25 +0000 (18:02 +0200)
committerDavid Bremner <bremner@debian.org>
Fri, 18 Nov 2011 18:53:51 +0000 (13:53 -0500)
Some tests don't break when HUP signal is sent tho those (by
pressing ctrl-c on the terminal). Therefore, the top-level
test script catches the HUP and sends TERM signal to the
started test script.

test/notmuch-test

index adfd589fe0765d19d575d4714f59ef4f352b6022..6c65ed7a282bed731cc5bd4bbf0ce5196ee84dbd 100755 (executable)
@@ -60,10 +60,13 @@ else
     TEST_TIMEOUT_CMD=""
 fi
 
+trap 'e=$?; kill $!; exit $e' HUP INT TERM
 # Run the tests
 for test in $TESTS; do
-    $TEST_TIMEOUT_CMD ./$test "$@"
+    $TEST_TIMEOUT_CMD ./$test "$@" &
+    wait $!
 done
+trap - HUP INT TERM
 
 # Report results
 ./aggregate-results.sh test-results/*