From 659bcf8d96b3da19c0debce9a7eb37920b1ed28d Mon Sep 17 00:00:00 2001 From: Ivan Zakharyaschev Date: Thu, 16 Jan 2014 12:48:11 +0400 Subject: [PATCH] tests: Do not clean up after failed tests. --- run-tests.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/run-tests.sh b/run-tests.sh index 6af7266..e9b374e 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -35,15 +35,24 @@ status=0 for t in "${TESTS[@]}"; do echo -n "################################### " echo "Running $(basename "$t")..." + + # The absolute path will be needed after a pushd: t="$(absolute "$t")" + + # Clean up what has been left by previous tests: rm -rf "$TMP"/test-gitgitconfig + mkdir "$TMP"/test-gitgitconfig pushd "$TMP"/test-gitgitconfig if "$t"; then echo OK; else echo FAILED; let '++ status'; fi popd - rm -rf "$TMP"/test-gitgitconfig done echo "$status tests failed." +# Clean up if there have been no errors. Otherwise leave it for inspection. +if (( status == 0 )); then + rm -rf "$TMP"/test-gitgitconfig +fi + exit $status -- 2.11.4.GIT