From: Tomi Ollila Date: Wed, 16 Nov 2011 19:09:00 +0000 (+0200) Subject: test: create TEST_TMPDIR for holding temporary files X-Git-Tag: 0.10_rc2~2 X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=commitdiff_plain;h=a0ec104f13f66611b6e51cd9b49f4306f4fce8b7 test: create TEST_TMPDIR for holding temporary files The TEST_TMPDIR if first needed to hold dtach's socket (due to 108-character limit in socket file names). Later it can be used to hold other temporary files; directory deleted at exit. --- diff --git a/test/test-lib.sh b/test/test-lib.sh index 1ea7fa97..87f78c99 100755 --- a/test/test-lib.sh +++ b/test/test-lib.sh @@ -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 () {