2010-12-01 21:27:52 +01:00
|
|
|
#!/usr/bin/env bash
|
2010-01-23 19:36:39 +01:00
|
|
|
|
2010-09-17 21:10:54 +02:00
|
|
|
# Run tests
|
|
|
|
#
|
|
|
|
# Copyright (c) 2005 Junio C Hamano
|
|
|
|
#
|
|
|
|
# Adapted from a Makefile to a shell script by Carl Worth (2010)
|
|
|
|
|
2010-10-28 21:07:42 +02:00
|
|
|
if [ ${BASH_VERSINFO[0]} -lt 4 ]; then
|
|
|
|
echo "Error: The notmuch test suite requires a bash version >= 4.0"
|
|
|
|
echo "due to use of associative arrays within the test suite."
|
|
|
|
echo "Please try again with a newer bash (or help us fix the"
|
|
|
|
echo "test suite to be more portable). Thanks."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2010-09-17 21:10:54 +02:00
|
|
|
cd $(dirname "$0")
|
|
|
|
|
2011-01-23 12:12:24 +01:00
|
|
|
TESTS="
|
|
|
|
basic
|
2011-11-25 18:28:11 +01:00
|
|
|
help-test
|
2012-04-14 03:41:03 +02:00
|
|
|
config
|
2011-01-23 12:12:24 +01:00
|
|
|
new
|
2011-11-15 21:08:52 +01:00
|
|
|
count
|
2011-01-23 12:12:24 +01:00
|
|
|
search
|
|
|
|
search-output
|
|
|
|
search-by-folder
|
|
|
|
search-position-overlap-bug
|
2011-01-28 21:21:25 +01:00
|
|
|
search-insufficient-from-quoting
|
2011-11-15 21:08:53 +01:00
|
|
|
search-limiting
|
2012-04-07 18:10:07 +02:00
|
|
|
excludes
|
2011-11-08 04:57:11 +01:00
|
|
|
tagging
|
2011-01-23 12:12:24 +01:00
|
|
|
json
|
2012-06-24 05:27:48 +02:00
|
|
|
text
|
2011-05-17 00:25:25 +02:00
|
|
|
multipart
|
2011-01-23 12:12:24 +01:00
|
|
|
thread-naming
|
|
|
|
raw
|
|
|
|
reply
|
2012-01-14 15:46:19 +01:00
|
|
|
reply-to-sender
|
2011-01-23 12:12:24 +01:00
|
|
|
dump-restore
|
|
|
|
uuencode
|
|
|
|
thread-order
|
|
|
|
author-order
|
|
|
|
from-guessing
|
|
|
|
long-id
|
|
|
|
encoding
|
|
|
|
emacs
|
2011-03-10 22:22:04 +01:00
|
|
|
emacs-large-search-buffer
|
2011-12-27 17:04:40 +01:00
|
|
|
emacs-subject-to-filename
|
2011-01-23 12:12:24 +01:00
|
|
|
maildir-sync
|
2011-05-26 03:01:16 +02:00
|
|
|
crypto
|
2011-06-22 13:58:01 +02:00
|
|
|
symbol-hiding
|
2011-06-27 19:12:24 +02:00
|
|
|
search-folder-coherence
|
2011-01-28 19:03:24 +01:00
|
|
|
atomicity
|
2011-12-05 02:50:08 +01:00
|
|
|
python
|
2011-12-08 23:48:31 +01:00
|
|
|
hooks
|
2011-12-07 19:37:13 +01:00
|
|
|
argument-parsing
|
2012-01-28 05:47:39 +01:00
|
|
|
emacs-test-functions
|
|
|
|
emacs-address-cleaning
|
2012-02-17 15:48:08 +01:00
|
|
|
emacs-hello
|
2012-02-04 08:36:36 +01:00
|
|
|
emacs-show
|
2012-08-08 03:28:33 +02:00
|
|
|
missing-headers
|
2011-01-23 12:12:24 +01:00
|
|
|
"
|
2011-05-07 21:08:34 +02:00
|
|
|
TESTS=${NOTMUCH_TESTS:=$TESTS}
|
2010-09-18 00:58:39 +02:00
|
|
|
|
2010-09-17 21:10:54 +02:00
|
|
|
# Clean up any results from a previous run
|
2010-12-08 00:28:44 +01:00
|
|
|
rm -r test-results >/dev/null 2>/dev/null
|
2010-09-17 21:10:54 +02:00
|
|
|
|
2011-05-28 11:50:11 +02:00
|
|
|
# test for timeout utility
|
|
|
|
if command -v timeout >/dev/null; then
|
|
|
|
TEST_TIMEOUT_CMD="timeout 2m "
|
|
|
|
echo "INFO: using 2 minute timeout for tests"
|
|
|
|
else
|
|
|
|
TEST_TIMEOUT_CMD=""
|
|
|
|
fi
|
|
|
|
|
2011-11-08 17:02:25 +01:00
|
|
|
trap 'e=$?; kill $!; exit $e' HUP INT TERM
|
2010-09-17 21:10:54 +02:00
|
|
|
# Run the tests
|
2010-09-18 00:58:39 +02:00
|
|
|
for test in $TESTS; do
|
2011-11-08 17:02:25 +01:00
|
|
|
$TEST_TIMEOUT_CMD ./$test "$@" &
|
|
|
|
wait $!
|
2010-09-17 21:10:54 +02:00
|
|
|
done
|
2011-11-08 17:02:25 +01:00
|
|
|
trap - HUP INT TERM
|
2010-09-17 21:10:54 +02:00
|
|
|
|
|
|
|
# Report results
|
2010-09-18 00:58:39 +02:00
|
|
|
./aggregate-results.sh test-results/*
|
2010-09-17 21:10:54 +02:00
|
|
|
|
|
|
|
# Clean up
|
2011-05-07 21:10:04 +02:00
|
|
|
rm -rf test-results corpus.mail
|