test: unbreak performance tests
authorDavid Bremner <david@tethera.net>
Sat, 2 Dec 2017 12:53:04 +0000 (08:53 -0400)
committerDavid Bremner <david@tethera.net>
Tue, 5 Dec 2017 01:04:38 +0000 (21:04 -0400)
In 8e7fb88237aedea22 Jani replaced the use of $(pwd -P) to find the
TEST_DIRECTORY in order to better support out of tree
builds. Unfortunately the performance-tests need a different value for
the variable and were thus broken.

This commit splits out the setting of this variable for the two sets
of tests.  Performance tests still don't work out of tree, because
the handling of the downloaded corpus needs to be updated.

performance-test/perf-test-lib.sh
test/test-lib-common.sh
test/test-lib.sh

index 56538abddcdbc1d8950f62a6f2d73fd1aa7d7dda..b70288ccaf316158b5c6ab16a46bff799c1b46a0 100644 (file)
@@ -29,6 +29,9 @@ done
 # Ensure NOTMUCH_SRCDIR and NOTMUCH_BUILDDIR are set.
 . $(dirname "$0")/../test/export-dirs.sh || exit 1
 
+# Where to run the tests
+TEST_DIRECTORY=$NOTMUCH_BUILDDIR/performance-test
+
 . "$NOTMUCH_SRCDIR/test/test-lib-common.sh" || exit 1
 
 set -e
index 6c3571d4c56001b65402ac4658662684b8613839..2f7950ac75b7b6c61777560bb933d847b9a7e3f7 100644 (file)
@@ -41,10 +41,6 @@ restore_database () {
     cp -pR $TMP_DIRECTORY/notmuch-dir-backup."${test_name}" ${MAIL_DIR}/.notmuch
 }
 
-# Test the binaries we have just built.  The tests are kept in
-# test/ subdirectory and are run in 'trash directory' subdirectory.
-TEST_DIRECTORY=$NOTMUCH_BUILDDIR/test
-
 # Prepend $TEST_DIRECTORY/../lib to LD_LIBRARY_PATH, to make tests work
 # on systems where ../notmuch depends on LD_LIBRARY_PATH.
 LD_LIBRARY_PATH=${TEST_DIRECTORY%/*}/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
index 42a45f158105f8c4885ff4ebed5512297d7e118a..4c8607a1c3d538b83ab5f645b32fd90dc153f293 100644 (file)
@@ -1066,6 +1066,9 @@ test_init_ () {
 }
 
 
+# Where to run the tests
+TEST_DIRECTORY=$NOTMUCH_BUILDDIR/test
+
 . "$NOTMUCH_SRCDIR/test/test-lib-common.sh" || exit 1
 
 if [ "${NOTMUCH_GMIME_MAJOR}" = 3 ]; then