summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2019-07-25 19:01:44 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2019-08-11 00:09:27 +0100
commitc142f82d221a3235b484c58fa57ea23f300fa5e6 (patch)
tree7a9fb293c28dddf05b7b28195f5eb050b05d96f5 /tests
parent95e855e90d3180fffb41ee4671aa496299945239 (diff)
test suite: lib: Provide $tmp/must-clean directory to tests
This is a directory for things which should be removed on exit. Currently there are none. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'tests')
-rw-r--r--tests/lib15
1 files changed, 14 insertions, 1 deletions
diff --git a/tests/lib b/tests/lib
index 78ec9a7..6f36130 100644
--- a/tests/lib
+++ b/tests/lib
@@ -22,7 +22,13 @@ END
exit 16
}
-trap 'test $? = 0 || t-report-failure' EXIT
+trap '
+ rc=$?
+ set +e
+ [ "x$DGIT_TEST_TMP" = x ] || rm -rf $DGIT_TEST_TMP/must-clean
+ set -e
+ test $rc = 0 || t-report-failure
+' EXIT
t-filter-out-git-hyphen-dir
@@ -74,6 +80,11 @@ export DEBCHANGE_VENDOR=dpkg
unset VISUAL
unset GIT_EDITOR
+mkdir -p $tmp/must-clean
+# must-clean is usually removed after each test, on success or failure.
+# But this must not be relied on for correctness, only for garbage
+# collection etc.
+
mkdir -p $tmp/incoming
cat <<END >$tmp/dput.cf
[test-dummy]
@@ -573,6 +584,8 @@ t-setup-import () {
(set -e; cd $tmp; tar xf "$simport.tar")
fi
+ mkdir -p $tmp/must-clean
+
. "$simport"
}