summaryrefslogtreecommitdiff
path: root/tests/run-all
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2018-08-26 11:38:57 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2018-08-26 11:54:41 +0100
commit8fe6ad4c7d368717a4bfa6e2c6459980d65cf95a (patch)
tree509e09a65dd8d7cfaa68cb5ee048d3204a4c96ce /tests/run-all
parent8744462e90f4af03214a1398d829c69ad034b4c6 (diff)
test suite: run-all: Honour DGIT_TESTS_TMPDIR
If this variable is set, tests/tmp will be made a symlink to a real subdirectory under $DGIT_TESTS_TMPDIR. The real subdirectory will be removed and recreated as tests/tmp would otherwise be. I set it to /run/user/`id -u`/dgit-tests-tmp Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'tests/run-all')
-rwxr-xr-xtests/run-all12
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/run-all b/tests/run-all
index e1718fa..a37b6aa 100755
--- a/tests/run-all
+++ b/tests/run-all
@@ -21,7 +21,17 @@ if [ $# != 0 ]; then
set TESTSCRIPTS="$*"
fi
-tmpdir=tests/tmp
+if [ "x$DGIT_TESTS_TMPDIR" != x ]; then
+ tmpdir="$PWD"
+ tmpdir="${tmpdir#/}"
+ tmpdir="${tmpdir//!/!#!}"
+ tmpdir="${tmpdir//\//!}"
+ tmpdir="$DGIT_TESTS_TMPDIR/$tmpdir"
+ rm -f tests/tmp
+ ln -ns -- "$tmpdir" tests/tmp
+else
+ tmpdir=tests/tmp
+fi
case "$DGIT_TESTS_PROGRESSIVE" in
''|n)