diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2018-08-26 11:38:57 +0100 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2018-08-26 11:54:41 +0100 |
commit | 8fe6ad4c7d368717a4bfa6e2c6459980d65cf95a (patch) | |
tree | 509e09a65dd8d7cfaa68cb5ee048d3204a4c96ce /tests | |
parent | 8744462e90f4af03214a1398d829c69ad034b4c6 (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')
-rwxr-xr-x | tests/run-all | 12 |
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) |