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.
This commit is contained in:
Tomi Ollila 2011-11-16 21:09:00 +02:00 committed by David Bremner
parent 299e187bdf
commit a0ec104f13

View file

@ -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 () {