5 # Copyright (c) 2005 Junio C Hamano
6 # Copyright (c) 2010 Notmuch Developers
8 # Adapted from a Makefile to a shell script by Carl Worth (2010)
10 if [ ${BASH_VERSINFO[0]} -lt 4 ]; then
11 echo "Error: The notmuch test suite requires a bash version >= 4.0"
12 echo "due to use of associative arrays within the test suite."
13 echo "Please try again with a newer bash (or help us fix the"
14 echo "test suite to be more portable). Thanks."
20 TESTS=${NOTMUCH_TESTS:-`echo T[0-9][0-9][0-9]-*.sh`}
22 # Clean up any results from a previous run
23 rm -r test-results >/dev/null 2>/dev/null
25 # test for timeout utility
26 if command -v timeout >/dev/null; then
27 TEST_TIMEOUT_CMD="timeout 2m "
28 echo "INFO: using 2 minute timeout for tests"
33 trap 'e=$?; kill $!; exit $e' HUP INT TERM
35 for test in $TESTS; do
36 $TEST_TIMEOUT_CMD ./$test "$@" &
38 # If the test failed without producing results, then it aborted,
39 # so we should abort, too.
41 if [[ $RES != 0 && ! -e "test-results/${test%.sh}" ]]; then
49 ./aggregate-results.sh test-results/*
53 rm -rf test-results corpus.mail