aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/test-lib.sh
diff options
context:
space:
mode:
authorGravatar Tomi Ollila <tomi.ollila@iki.fi>2011-11-16 21:09:00 +0200
committerGravatar David Bremner <bremner@debian.org>2011-11-17 19:35:32 -0400
commita0ec104f13f66611b6e51cd9b49f4306f4fce8b7 (patch)
treea7a03c3e6c13e07db4f71d314eed40b07d76409e /test/test-lib.sh
parent299e187bdfae86538065acc6f7bc8d470cdfae21 (diff)
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.
Diffstat (limited to 'test/test-lib.sh')
-rwxr-xr-xtest/test-lib.sh3
1 files changed, 3 insertions, 0 deletions
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 () {