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