]> git.notmuchmail.org Git - notmuch/blobdiff - test/test-lib.sh
test: create TEST_TMPDIR for holding temporary files
[notmuch] / test / test-lib.sh
index 1ea7fa976b8acd01f212c30f9627ceedcde7a9b4..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 () {