set -eu
+# Where to run the tests
+# XXX FIXME this code is duplicated with test-lib.sh
+if [[ -n "${NOTMUCH_BUILDDIR}" ]]; then
+ TEST_DIRECTORY=$NOTMUCH_BUILDDIR/test
+else
+ TEST_DIRECTORY=$NOTMUCH_SRCDIR/test
+fi
+
TESTS=
for test in ${NOTMUCH_TESTS-}; do
TESTS="$TESTS $NOTMUCH_SRCDIR/test/$test"
# Run the tests
if test -z "${NOTMUCH_TEST_SERIALIZE-}" && command -v parallel >/dev/null ; then
test -t 1 && export COLORS_WITHOUT_TTY=t || :
- if parallel --version 2>&1 | grep -q GNU ; then
+ if parallel --minversion 0 >/dev/null 2>&1 ; then
echo "INFO: running tests with GNU parallel"
printf '%s\n' $TESTS | $TEST_TIMEOUT_CMD parallel || RES=$?
else
do
file=${file##*/} # drop leading path components
file=${file%.sh} # drop trailing '.sh'
- RESULT_FILES="$RESULT_FILES $NOTMUCH_BUILDDIR/test/test-results/$file"
+ RESULT_FILES="$RESULT_FILES $TEST_DIRECTORY/test-results/$file"
done
echo
fi
# Clean up
-rm -rf $NOTMUCH_BUILDDIR/test/test-results
+rm -rf $TEST_DIRECTORY/test-results
exit $ev