git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] t1304,t2007: quell output to stdout and stderr

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Apr 21, 2010, 14:45 UTC
Message-ID
<20100421144535.GA8481@progeny.tock>
In-Reply-To
<00e68c9727f8dd3426db6f78d6b583a0dcec4d13.1271858119.git.git@drmicha.warpmail.net>
Hi Michael,
Michael J Gruber wrote:
Show 11 quoted lines
> --- 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
 
 '
Previous: Michael J GruberNext: Michael J Gruber
Message 2 of 6 in “t1304,t2007: quell output to stdout and stderr”
  1. t1304,t2007: quell output to stdout and stderrMichael J Gruber, Apr 21, 2010
  2. Jonathan NiederApr 21, 2010
  3. Michael J GruberApr 21, 2010
  4. Jonathan NiederApr 21, 2010
  5. t1304,t2007: quell output to stdout and stderrMichael J Gruber, Apr 22, 2010
  6. Michael J GruberMay 26, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.