]> git.notmuchmail.org Git - notmuch/blob - test/notmuch-test
test: add tests for date:since..until range queries
[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   text
35   multipart
36   thread-naming
37   raw
38   reply
39   reply-to-sender
40   dump-restore
41   uuencode
42   thread-order
43   author-order
44   from-guessing
45   long-id
46   encoding
47   emacs
48   emacs-large-search-buffer
49   emacs-subject-to-filename
50   maildir-sync
51   crypto
52   symbol-hiding
53   search-folder-coherence
54   atomicity
55   python
56   hooks
57   argument-parsing
58   emacs-test-functions
59   emacs-address-cleaning
60   emacs-hello
61   emacs-show
62   missing-headers
63   parse-time-string
64   search-date
65 "
66 TESTS=${NOTMUCH_TESTS:=$TESTS}
67
68 # Clean up any results from a previous run
69 rm -r test-results >/dev/null 2>/dev/null
70
71 # test for timeout utility
72 if command -v timeout >/dev/null; then
73     TEST_TIMEOUT_CMD="timeout 2m "
74     echo "INFO: using 2 minute timeout for tests"
75 else
76     TEST_TIMEOUT_CMD=""
77 fi
78
79 trap 'e=$?; kill $!; exit $e' HUP INT TERM
80 # Run the tests
81 for test in $TESTS; do
82     $TEST_TIMEOUT_CMD ./$test "$@" &
83     wait $!
84 done
85 trap - HUP INT TERM
86
87 # Report results
88 ./aggregate-results.sh test-results/*
89
90 # Clean up
91 rm -rf test-results corpus.mail