]> git.notmuchmail.org Git - notmuch/blob - test/notmuch-test
738f8f64f22c3d03c9a43cd8e8d407040b7b93a6
[notmuch] / test / notmuch-test
1 #!/usr/bin/env bash
2
3 # Run tests
4 #
5 # Copyright (c) 2005 Junio C Hamano
6 #
7 # Adapted from a Makefile to a shell script by Carl Worth (2010)
8
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."
14     exit 1
15 fi
16
17 cd $(dirname "$0")
18
19 TESTS="
20   basic
21   new
22   search
23   search-output
24   search-by-folder
25   search-position-overlap-bug
26   search-insufficient-from-quoting
27   json
28   multipart
29   thread-naming
30   raw
31   reply
32   dump-restore
33   uuencode
34   thread-order
35   author-order
36   from-guessing
37   long-id
38   encoding
39   emacs
40   emacs-large-search-buffer
41   maildir-sync
42   crypto
43   symbol-hiding
44   search-folder-coherence
45   atomicity
46 "
47 TESTS=${NOTMUCH_TESTS:=$TESTS}
48
49 # Clean up any results from a previous run
50 rm -r test-results >/dev/null 2>/dev/null
51
52 # test for timeout utility
53 if command -v timeout >/dev/null; then
54     TEST_TIMEOUT_CMD="timeout 2m "
55     echo "INFO: using 2 minute timeout for tests"
56 else
57     TEST_TIMEOUT_CMD=""
58 fi
59
60 # Run the tests
61 for test in $TESTS; do
62     $TEST_TIMEOUT_CMD ./$test "$@"
63 done
64
65 # Report results
66 ./aggregate-results.sh test-results/*
67
68 # Clean up
69 rm -rf test-results corpus.mail