]> git.notmuchmail.org Git - notmuch/blob - test/notmuch-test
test: add tests for notmuch count
[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   count
23   search
24   search-output
25   search-by-folder
26   search-position-overlap-bug
27   search-insufficient-from-quoting
28   tagging
29   json
30   multipart
31   thread-naming
32   raw
33   reply
34   dump-restore
35   uuencode
36   thread-order
37   author-order
38   from-guessing
39   long-id
40   encoding
41   emacs
42   emacs-large-search-buffer
43   maildir-sync
44   crypto
45   symbol-hiding
46   search-folder-coherence
47   atomicity
48 "
49 TESTS=${NOTMUCH_TESTS:=$TESTS}
50
51 # Clean up any results from a previous run
52 rm -r test-results >/dev/null 2>/dev/null
53
54 # test for timeout utility
55 if command -v timeout >/dev/null; then
56     TEST_TIMEOUT_CMD="timeout 2m "
57     echo "INFO: using 2 minute timeout for tests"
58 else
59     TEST_TIMEOUT_CMD=""
60 fi
61
62 # Run the tests
63 for test in $TESTS; do
64     $TEST_TIMEOUT_CMD ./$test "$@"
65 done
66
67 # Report results
68 ./aggregate-results.sh test-results/*
69
70 # Clean up
71 rm -rf test-results corpus.mail