X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ftest-lib.sh;h=6212c46cc1d73695790e7888c0640fe629210abe;hb=16cccd8bff6c0cf2700b169215a831ac63d6b145;hp=8e2849b5ce915c3984894628e8e3ce990812ddfd;hpb=88bbda08d7b9503862a8fb8846d78c67825e5e3d;p=git.git diff --git a/t/test-lib.sh b/t/test-lib.sh index 8e2849b5c..6212c46cc 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -379,7 +379,7 @@ test_external_without_stderr () { test_must_fail () { "$@" - test $? -gt 0 -a $? -le 129 + test $? -gt 0 -a $? -le 129 -o $? -gt 192 } # test_cmp is a helper function to compare actual and expected output. @@ -406,7 +406,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?" @@ -449,6 +449,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 ;; *) @@ -485,7 +490,8 @@ fi . ../GIT-BUILD-OPTIONS # Test repository -test="trash directory" +test="trash directory.$(basename "$0" .sh)" +remove_trash="$TEST_DIRECTORY/$test" rm -fr "$test" || { trap - exit echo >&5 "FATAL: Cannot prepare test area"