]> git.notmuchmail.org Git - notmuch/commitdiff
test: Create and set temporary home directory
authorFlorian Friesdorf <flo@chaoflow.net>
Mon, 18 Apr 2011 17:41:39 +0000 (19:41 +0200)
committerCarl Worth <cworth@cworth.org>
Thu, 2 Jun 2011 00:46:51 +0000 (17:46 -0700)
In the master branch in test/emacs two tests access the build users home
directory, so does emacs_deliver_message in the crypto branch.

The tests should not touch the build user's home directory. The patch
creates a directory in the temporary test directory and sets home
accordingly.

In case of a non-existent home directory, the tests are failing without
this patch.

Signed-off-by: Jameson Graef Rollins <jrollins@finestructure.net>
test/test-lib.sh

index 7855609248e72d1961cc22e21192b577a901395b..a59d1c1363fbc5964bd0946aa8cfbda7b84d64a9 100755 (executable)
@@ -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"