]> git.notmuchmail.org Git - notmuch/blobdiff - test/test-lib.sh
Merge remote-tracking branch 'origin/master'
[notmuch] / test / test-lib.sh
index 922b1ef536350fb91ba5988fdde991e1fdf7d79a..cc20f414b6e670a2ae788dae7a810e27d0b97e0d 100755 (executable)
@@ -424,7 +424,7 @@ test_begin_subtest ()
        error "bug in test script: Missing test_expect_equal in ${BASH_SOURCE[1]}:${BASH_LINENO[0]}"
     fi
     test_subtest_name="$1"
-    # Remember stdout and stderr file descriptios and redirect test
+    # Remember stdout and stderr file descriptors and redirect test
     # output to the previously prepared file descriptors 3 and 4 (see
     # below)
     if test "$verbose" != "t"; then exec 4>test.output 3>&4; fi
@@ -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"