2010-12-01 21:27:52 +01:00
|
|
|
#!/usr/bin/env bash
|
2010-01-24 07:36:39 +13:00
|
|
|
|
2010-09-17 12:10:54 -07:00
|
|
|
# Run tests
|
|
|
|
#
|
|
|
|
# Copyright (c) 2005 Junio C Hamano
|
|
|
|
#
|
|
|
|
# Adapted from a Makefile to a shell script by Carl Worth (2010)
|
|
|
|
|
2010-10-28 12:07:42 -07: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 12:10:54 -07:00
|
|
|
cd $(dirname "$0")
|
|
|
|
|
2011-01-23 12:12:24 +01:00
|
|
|
TESTS="
|
|
|
|
basic
|
|
|
|
new
|
|
|
|
search
|
|
|
|
search-output
|
|
|
|
search-by-folder
|
|
|
|
search-position-overlap-bug
|
2011-01-29 06:21:25 +10:00
|
|
|
search-insufficient-from-quoting
|
2011-01-23 12:12:24 +01:00
|
|
|
json
|
2011-05-16 15:25:25 -07:00
|
|
|
multipart
|
2011-01-23 12:12:24 +01:00
|
|
|
thread-naming
|
|
|
|
raw
|
|
|
|
reply
|
|
|
|
dump-restore
|
|
|
|
uuencode
|
|
|
|
thread-order
|
|
|
|
author-order
|
|
|
|
from-guessing
|
|
|
|
long-id
|
|
|
|
encoding
|
|
|
|
emacs
|
2011-03-10 13:22:04 -08:00
|
|
|
emacs-large-search-buffer
|
2011-01-23 12:12:24 +01:00
|
|
|
maildir-sync
|
2011-05-25 18:01:16 -07:00
|
|
|
crypto
|
2011-06-22 08:58:01 -03:00
|
|
|
symbol-hiding
|
2011-06-27 11:12:24 -06:00
|
|
|
search-folder-coherence
|
2011-01-23 12:12:24 +01:00
|
|
|
"
|
2011-05-07 12:08:34 -07:00
|
|
|
TESTS=${NOTMUCH_TESTS:=$TESTS}
|
2010-09-17 15:58:39 -07:00
|
|
|
|
2010-09-17 12:10:54 -07:00
|
|
|
# Clean up any results from a previous run
|
2010-12-07 15:28:44 -08:00
|
|
|
rm -r test-results >/dev/null 2>/dev/null
|
2010-09-17 12:10:54 -07:00
|
|
|
|
2011-05-28 06:50:11 -03: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
|
|
|
|
|
2010-09-17 12:10:54 -07:00
|
|
|
# Run the tests
|
2010-09-17 15:58:39 -07:00
|
|
|
for test in $TESTS; do
|
2011-05-28 06:50:11 -03:00
|
|
|
$TEST_TIMEOUT_CMD ./$test "$@"
|
2010-09-17 12:10:54 -07:00
|
|
|
done
|
|
|
|
|
|
|
|
# Report results
|
2010-09-17 15:58:39 -07:00
|
|
|
./aggregate-results.sh test-results/*
|
2010-09-17 12:10:54 -07:00
|
|
|
|
|
|
|
# Clean up
|
2011-05-07 12:10:04 -07:00
|
|
|
rm -rf test-results corpus.mail
|