]> git.notmuchmail.org Git - notmuch/blob - test/notmuch-test
new: Handle fatal errors in remove_filename and _remove_directory
[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   help-test
22   new
23   count
24   search
25   search-output
26   search-by-folder
27   search-position-overlap-bug
28   search-insufficient-from-quoting
29   search-limiting
30   excludes
31   tagging
32   json
33   multipart
34   thread-naming
35   raw
36   reply
37   reply-to-sender
38   dump-restore
39   uuencode
40   thread-order
41   author-order
42   from-guessing
43   long-id
44   encoding
45   emacs
46   emacs-large-search-buffer
47   emacs-subject-to-filename
48   maildir-sync
49   crypto
50   symbol-hiding
51   search-folder-coherence
52   atomicity
53   python
54   hooks
55   argument-parsing
56   emacs-test-functions
57   emacs-address-cleaning
58   emacs-hello
59   emacs-show
60 "
61 TESTS=${NOTMUCH_TESTS:=$TESTS}
62
63 # Clean up any results from a previous run
64 rm -r test-results >/dev/null 2>/dev/null
65
66 # test for timeout utility
67 if command -v timeout >/dev/null; then
68     TEST_TIMEOUT_CMD="timeout 2m "
69     echo "INFO: using 2 minute timeout for tests"
70 else
71     TEST_TIMEOUT_CMD=""
72 fi
73
74 trap 'e=$?; kill $!; exit $e' HUP INT TERM
75 # Run the tests
76 for test in $TESTS; do
77     $TEST_TIMEOUT_CMD ./$test "$@" &
78     wait $!
79 done
80 trap - HUP INT TERM
81
82 # Report results
83 ./aggregate-results.sh test-results/*
84
85 # Clean up
86 rm -rf test-results corpus.mail