]> git.cworth.org Git - notmuch/blobdiff - test/test-lib.sh
test: create TEST_TMPDIR for holding temporary files
[notmuch] / test / test-lib.sh
index d88548b3838868146269dbdc2dcf1992ab04a22d..87f78c999a14de58d4d325f76f615a944dac3217 100755 (executable)
@@ -174,6 +174,7 @@ test_success=0
 
 die () {
        code=$?
+       rm -rf "$TEST_TMPDIR"
        if test -n "$GIT_EXIT_OK"
        then
                exit $code
@@ -184,6 +185,8 @@ die () {
 }
 
 GIT_EXIT_OK=
+# Note: TEST_TMPDIR *NOT* exported!
+TEST_TMPDIR=$(mktemp -d "${TMPDIR:-/tmp}/notmuch-test-$$.XXXXXX")
 trap 'die' EXIT
 
 test_decode_color () {
@@ -394,7 +397,7 @@ emacs_deliver_message ()
           (message-goto-body)
           (insert \"${body}\")
           $@
-          (message-send-and-exit))" >/dev/null 2>&1
+          (message-send-and-exit))"
     wait ${smtp_dummy_pid}
     notmuch new >/dev/null
 }
@@ -830,7 +833,7 @@ export NOTMUCH_CONFIG=$NOTMUCH_CONFIG
 #
 # --load               Force loading of notmuch.el and test-lib.el
 
-emacs --no-init-file --no-site-file \
+exec emacs --no-init-file --no-site-file \
        --directory "$TEST_DIRECTORY/../emacs" --load notmuch.el \
        --directory "$TEST_DIRECTORY" --load test-lib.el \
        "\$@"