]> git.notmuchmail.org Git - notmuch/blobdiff - test/test-lib.sh
test: Create and set temporary home directory
[notmuch] / test / test-lib.sh
index 922b1ef536350fb91ba5988fdde991e1fdf7d79a..a59d1c1363fbc5964bd0946aa8cfbda7b84d64a9 100755 (executable)
@@ -477,8 +477,8 @@ test_expect_equal_file ()
                        test_ok_ "$test_subtest_name"
                else
                        testname=$this_test.$test_count
-                       mv "$output" $testname.output
-                       mv "$expected" $testname.expected
+                       cp "$output" $testname.output
+                       cp "$expected" $testname.expected
                        test_failure_ "$test_subtest_name" "$(diff -u $testname.expected $testname.output)"
                fi
     fi
@@ -973,6 +973,13 @@ rm -fr "$test" || {
        exit 1
 }
 
+# A temporary home directory is needed by at least:
+# - emacs/"Sending a message via (fake) SMTP"
+# - emacs/"Reply within emacs"
+# - crypto/emacs_deliver_message
+export HOME="${TMP_DIRECTORY}/home"
+mkdir -p "${HOME}"
+
 MAIL_DIR="${TMP_DIRECTORY}/mail"
 export GNUPGHOME="${TMP_DIRECTORY}/gnupg"
 export NOTMUCH_CONFIG="${TMP_DIRECTORY}/notmuch-config"