git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Nieder <jrnieder@gmail.com>
To: Michael J Gruber <git@drmicha.warpmail.net>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH] t1304,t2007: quell output to stdout and stderr
Date: Wed, 21 Apr 2010 09:45:35 -0500	[thread overview]
Message-ID: <20100421144535.GA8481@progeny.tock> (raw)
In-Reply-To: <00e68c9727f8dd3426db6f78d6b583a0dcec4d13.1271858119.git.git@drmicha.warpmail.net>

Hi Michael,

Michael J Gruber wrote:

> --- a/t/t1304-default-acl.sh
> +++ b/t/t1304-default-acl.sh
> @@ -15,7 +15,7 @@ umask 077
>  # is a good candidate: exists on all unices, and it has permission
>  # anyway, so we don't create a security hole running the testsuite.
>  
> -if ! setfacl -m u:root:rwx .; then
> +if ! setfacl -m u:root:rwx . 2>/dev/null; then
>      say "Skipping ACL tests: unable to use setfacl"
>      test_done
>  fi
[and a similar suppression of ‘git checkout’ output]

In the spirit of commit 4a45f7d (Use test_expect_success for test
setups, 2010-03-20), might it make sense to turn these into tests?

I am imagining something like this.

diff --git a/t/t1304-default-acl.sh b/t/t1304-default-acl.sh
index b26d2e8..8b3ff7a 100755
--- a/t/t1304-default-acl.sh
+++ b/t/t1304-default-acl.sh
@@ -15,7 +15,15 @@ umask 077
 # is a good candidate: exists on all unices, and it has permission
 # anyway, so we don't create a security hole running the testsuite.
 
-if ! setfacl -m u:root:rwx . 2>/dev/null; then
+test_expect_success 'Setup: try to set an ACL' '
+	if setfacl -m u:root:rwx .
+	then
+		test_set_prereq ACL
+	fi
+'
+
+if ! test_have_prereq ACL
+then
     say "Skipping ACL tests: unable to use setfacl"
     test_done
 fi
diff --git a/t/t2007-checkout-symlink.sh b/t/t2007-checkout-symlink.sh
index fc5db05..f8f40e5 100755
--- a/t/t2007-checkout-symlink.sh
+++ b/t/t2007-checkout-symlink.sh
@@ -44,11 +44,12 @@ test_expect_success 'switch from symlink to dir' '
 
 '
 
-rm -fr frotz xyzzy nitfol &&
-git checkout -q -f master || exit
-
 test_expect_success 'switch from dir to symlink' '
 
+	rm -fr frotz xyzzy nitfol &&
+	git rm -fr . &&
+	git checkout -f master &&
+
 	git checkout side
 
 '

  reply	other threads:[~2010-04-21 14:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-21 13:55 [PATCH] t1304,t2007: quell output to stdout and stderr Michael J Gruber
2010-04-21 14:45 ` Jonathan Nieder [this message]
2010-04-21 14:53   ` Michael J Gruber
2010-04-21 15:12     ` Jonathan Nieder
2010-04-22 20:45       ` [PATCH v2] " Michael J Gruber
2010-05-26  9:08         ` Michael J Gruber

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=20100421144535.GA8481@progeny.tock \
    --to=jrnieder@gmail.com \
    --cc=git@drmicha.warpmail.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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).