From a0ec104f13f66611b6e51cd9b49f4306f4fce8b7 Mon Sep 17 00:00:00 2001 From: Tomi Ollila Date: Wed, 16 Nov 2011 21:09:00 +0200 Subject: [PATCH] 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. --- test/test-lib.sh | 3 +++ 1 file changed, 3 insertions(+) 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 () { -- 2.43.0