aboutsummaryrefslogtreecommitdiff
path: root/test/test-lib-common.sh
diff options
context:
space:
mode:
authorJani Nikula <jani@nikula.org>2017-10-21 14:58:02 +0300
committerDavid Bremner <david@tethera.net>2017-10-21 11:32:20 -0300
commitd455c8b74a2a63454779445e14ac3e81141b204a (patch)
treee9f3cb8cd040f18a2b837412e523f4cb4f5215a0 /test/test-lib-common.sh
parent409d87736461c551fac2f1956132b867f379db1b (diff)
test: remove --root option and fix TMP_DIRECTORY cleanup
The primary motivation here is to fix TMP_DIRECTORY cleanup prior to running each test when the current working directory is not the test subdirectory. Tests with failures would leave their TMP_DIRECTORY directory behind for debugging, and repeated out-of-tree test runs would have old temp directories. (This lead to e.g. T310-emacs.sh hanging because emacs would prompt for overwriting files.) We remove the likely anyway defunct --root test option while at it, just to be on the safe side when doing 'rm -rf' on the TMP_DIRECTORY.
Diffstat (limited to 'test/test-lib-common.sh')
-rw-r--r--test/test-lib-common.sh8
1 files changed, 2 insertions, 6 deletions
diff --git a/test/test-lib-common.sh b/test/test-lib-common.sh
index 5e53348a..4300eb65 100644
--- a/test/test-lib-common.sh
+++ b/test/test-lib-common.sh
@@ -307,13 +307,9 @@ export PATH MANPATH
# Test repository
test="tmp.$(basename "$0" .sh)"
-test -n "$root" && test="$root/$test"
-case "$test" in
-/*) TMP_DIRECTORY="$test" ;;
- *) TMP_DIRECTORY="$TEST_DIRECTORY/$test" ;;
-esac
+TMP_DIRECTORY="$TEST_DIRECTORY/$test"
test ! -z "$debug" || remove_tmp=$TMP_DIRECTORY
-rm -fr "$test" || {
+rm -rf "$TMP_DIRECTORY" || {
GIT_EXIT_OK=t
echo >&6 "FATAL: Cannot prepare test area"
exit 1