From: Ian Jackson Date: Sun, 26 Aug 2018 10:38:57 +0000 (+0100) Subject: test suite: run-all: Honour DGIT_TESTS_TMPDIR X-Git-Tag: archive/debian/6.10~16 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=commitdiff_plain;h=8fe6ad4c7d368717a4bfa6e2c6459980d65cf95a 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 --- diff --git a/tests/run-all b/tests/run-all index e1718fa9..a37b6aad 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)