From: Junio C Hamano <gitster@pobox.com>
To: git@vger.kernel.org
Subject: [PATCH] Test: catch if trash cannot be removed
Date: Tue, 18 Mar 2008 21:58:01 -0700 [thread overview]
Message-ID: <7vd4pr5mzq.fsf@gitster.siamese.dyndns.org> (raw)
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>
---
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 268b26c..870b255 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"
--
1.5.5.rc0.122.g8e28f
reply other threads:[~2008-03-19 19:43 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7vd4pr5mzq.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).