5 # Copyright (c) 2005 Junio C Hamano
7 # Adapted from a Makefile to a shell script by Carl Worth (2010)
9 if [ ${BASH_VERSINFO[0]} -lt 4 ]; then
10 echo "Error: The notmuch test suite requires a bash version >= 4.0"
11 echo "due to use of associative arrays within the test suite."
12 echo "Please try again with a newer bash (or help us fix the"
13 echo "test suite to be more portable). Thanks."
29 search-position-overlap-bug
30 search-insufficient-from-quoting
50 emacs-large-search-buffer
51 emacs-subject-to-filename
55 search-folder-coherence
61 emacs-address-cleaning
70 TESTS=${NOTMUCH_TESTS:=$TESTS}
72 # Clean up any results from a previous run
73 rm -r test-results >/dev/null 2>/dev/null
75 # test for timeout utility
76 if command -v timeout >/dev/null; then
77 TEST_TIMEOUT_CMD="timeout 2m "
78 echo "INFO: using 2 minute timeout for tests"
83 trap 'e=$?; kill $!; exit $e' HUP INT TERM
85 for test in $TESTS; do
86 $TEST_TIMEOUT_CMD ./$test "$@" &
88 # If the test failed without producing results, then it aborted,
89 # so we should abort, too.
91 if [[ $RES != 0 && ! -e "test-results/${test%.sh}" ]]; then
98 ./aggregate-results.sh test-results/*
101 rm -rf test-results corpus.mail