diff options
author | Junio C Hamano <gitster@pobox.com> | 2008-03-19 07:58:01 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-03-19 08:17:22 +0300 |
commit | 8d14ac945403d6d4b1de9f9fd680247e831c0bfc (patch) | |
tree | 75db696c9b6cc0ba2e7f2b5cb3f84a517470c3f1 /t/test-lib.sh | |
parent | 29dc13319883f97618de6f03e8ffc5dc810d8786 (diff) |
Test: catch if trash cannot be removed
When your test creates an unwritable directory that test framework cannot
clean out by "rm -fr trash", later tests cannot start in a fresh state
they expect to. Detect this and error out early.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/test-lib.sh')
-rw-r--r-- | t/test-lib.sh | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/t/test-lib.sh b/t/test-lib.sh index 268b26c959..870b255f13 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -396,7 +396,12 @@ fi # Test repository test=trash -rm -fr "$test" +rm -fr "$test" || { + trap - exit + echo >&5 "FATAL: Cannot prepare test area" + exit 1 +} + test_create_repo $test cd "$test" |