X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=test%2Fnotmuch-test;h=ca68dd416cfc17ab5132538b8fe36db37a6cbc5a;hp=ce142f7cd73094f880f72d870d913b7613b7a9b4;hb=HEAD;hpb=4b0c6fb2f1ba989fee554cb8fa2612046d6414a8 diff --git a/test/notmuch-test b/test/notmuch-test index ce142f7c..5d27e4d1 100755 --- a/test/notmuch-test +++ b/test/notmuch-test @@ -20,6 +20,14 @@ fi 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" @@ -51,7 +59,7 @@ RES=0 # 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 @@ -80,7 +88,7 @@ for file in $TESTS 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 @@ -94,6 +102,6 @@ if [ -n "$META_FAILURE" ]; then fi # Clean up -rm -rf $NOTMUCH_BUILDDIR/test/test-results +rm -rf $TEST_DIRECTORY/test-results exit $ev