]> git.notmuchmail.org Git - notmuch/blobdiff - test/test-lib-common.sh
test: fix test database backup/restore location
[notmuch] / test / test-lib-common.sh
index 5e53348a943886c99926aa24b748a62b14aa9ba3..6c3571d4c56001b65402ac4658662684b8613839 100644 (file)
@@ -31,14 +31,14 @@ fi
 
 backup_database () {
     test_name=$(basename $0 .sh)
-    rm -rf $NOTMUCH_BUILDDIR/test/notmuch-dir-backup."$test_name"
-    cp -pR ${MAIL_DIR}/.notmuch $NOTMUCH_BUILDDIR/test/notmuch-dir-backup."${test_name}"
+    rm -rf $TMP_DIRECTORY/notmuch-dir-backup."$test_name"
+    cp -pR ${MAIL_DIR}/.notmuch $TMP_DIRECTORY/notmuch-dir-backup."${test_name}"
 }
 
 restore_database () {
     test_name=$(basename $0 .sh)
     rm -rf ${MAIL_DIR}/.notmuch
-    cp -pR $NOTMUCH_BUILDDIR/test/notmuch-dir-backup."${test_name}" ${MAIL_DIR}/.notmuch
+    cp -pR $TMP_DIRECTORY/notmuch-dir-backup."${test_name}" ${MAIL_DIR}/.notmuch
 }
 
 # Test the binaries we have just built.  The tests are kept in
@@ -307,13 +307,9 @@ export PATH MANPATH
 
 # Test repository
 test="tmp.$(basename "$0" .sh)"
-test -n "$root" && test="$root/$test"
-case "$test" in
-/*) TMP_DIRECTORY="$test" ;;
- *) TMP_DIRECTORY="$TEST_DIRECTORY/$test" ;;
-esac
+TMP_DIRECTORY="$TEST_DIRECTORY/$test"
 test ! -z "$debug" || remove_tmp=$TMP_DIRECTORY
-rm -fr "$test" || {
+rm -rf "$TMP_DIRECTORY" || {
        GIT_EXIT_OK=t
        echo >&6 "FATAL: Cannot prepare test area"
        exit 1