From 0062cf69c0ebab465ae293dccfc2c903e0450312 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Fri, 30 Jun 2017 00:46:40 +0100 Subject: [PATCH] tests: Add TEST_SKIP_CLEANUP env var for skipping test cleanup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This mirrors the same environment variable in OSTreeā€™s unit tests, which keeps the temporary directory around after tests have completed (or failed) so the developer can examine it. Signed-off-by: Philip Withnall --- tests/libtest.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/libtest.sh b/tests/libtest.sh index badc96d6..8ed4f5b8 100644 --- a/tests/libtest.sh +++ b/tests/libtest.sh @@ -295,6 +295,10 @@ cleanup () { /bin/kill $DBUS_SESSION_BUS_PID ${FLATPAK_HTTP_PID:-} gpg-connect-agent --homedir "${FL_GPG_HOMEDIR}" killagent /bye || true fusermount -u $XDG_RUNTIME_DIR/doc || : - rm -rf $TEST_DATA_DIR + if test -n "${TEST_SKIP_CLEANUP:-}"; then + echo "Skipping cleanup of ${TEST_DATA_DIR}" + else + rm -rf $TEST_DATA_DIR + fi } trap cleanup EXIT