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