]> git.notmuchmail.org Git - notmuch/blob - test/notmuch-test
test: Leave tmp.<testname> for broken tests
[notmuch] / test / notmuch-test
1 #!/bin/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 set -e
18
19 die () {
20     echo >&2 "Unexpected failure"
21 }
22
23 trap 'die' 0
24
25 cd $(dirname "$0")
26
27 TESTS="basic new search search-output json thread-naming raw reply dump-restore uuencode thread-order author-order from-guessing long-id encoding emacs maildir-sync"
28
29 # Clean up any results from a previous run
30 rm -rf test-results >/dev/null 2>/dev/null
31
32 # Run the tests
33 for test in $TESTS; do
34         ./$test "$@"
35 done
36
37 # Report results
38 ./aggregate-results.sh test-results/*
39
40 # Clean up
41 rm -r test-results corpus.mail
42
43 trap '' 0