X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ftest-lib.sh;h=8936173ee204c589fb299837586b4866722b2388;hb=df5e12f7d405b84de07c3f2dc1afe51b1d594e2c;hp=689ac2f4b4eb45ee5f45f74e4c5d13c3e7c17e84;hpb=f6276b788f26c3c148c2d5465a6b03fc09bb785c;p=git.git diff --git a/t/test-lib.sh b/t/test-lib.sh index 689ac2f4b..8936173ee 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -407,7 +407,7 @@ test_create_repo () { error "bug in the test script: not 1 parameter to test-create-repo" owd=`pwd` repo="$1" - mkdir "$repo" + mkdir -p "$repo" cd "$repo" || error "Cannot setup test environment" "$GIT_EXEC_PATH/git" init "--template=$GIT_EXEC_PATH/templates/blt/" >&3 2>&4 || error "cannot run git init -- have you built things yet?" @@ -450,6 +450,11 @@ test_done () { # we will leave things as they are. say_color pass "passed all $msg" + + test -d "$remove_trash" && + cd "$(dirname "$remove_trash")" && + rm -rf "$(basename "$remove_trash")" + exit 0 ;; *) @@ -486,7 +491,8 @@ fi . ../GIT-BUILD-OPTIONS # Test repository -test="trash directory" +test="trash directory.$(basename "$0" .sh)" +test ! -z "$debug" || remove_trash="$TEST_DIRECTORY/$test" rm -fr "$test" || { trap - exit echo >&5 "FATAL: Cannot prepare test area"