git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Nieder <jrnieder@gmail.com>
To: git@vger.kernel.org
Cc: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
	"Clemens Buchacher" <drizzd@aon.at>,
	"Marc Branchaud" <marcnarc@xiplink.com>
Subject: [PATCH 7/9] test: make FILEMODE a lazy prereq
Date: Mon, 25 Nov 2013 13:02:16 -0800	[thread overview]
Message-ID: <20131125210216.GX4212@google.com> (raw)
In-Reply-To: <20131125205119.GQ4212@google.com>

This way, test authors don't need to remember to source
lib-prereq-FILEMODE.sh before using the FILEMODE prereq to guard tests
that rely on the executable bit being honored when checking out files.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
 t/lib-prereq-FILEMODE.sh       | 11 -----------
 t/t3701-add-interactive.sh     |  1 -
 t/t4102-apply-rename.sh        |  1 -
 t/t4120-apply-popt.sh          |  1 -
 t/t4129-apply-samemode.sh      |  1 -
 t/t6031-merge-recursive.sh     |  1 -
 t/t9200-git-cvsexportcommit.sh |  1 -
 t/test-lib.sh                  |  4 ++++
 8 files changed, 4 insertions(+), 17 deletions(-)
 delete mode 100644 t/lib-prereq-FILEMODE.sh

diff --git a/t/lib-prereq-FILEMODE.sh b/t/lib-prereq-FILEMODE.sh
deleted file mode 100644
index bce5a4c..0000000
--- a/t/lib-prereq-FILEMODE.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-#
-# Copyright (c) 2010 Ævar Arnfjörð Bjarmason
-#
-
-if test "$(git config --bool core.filemode)" = false
-then
-	say 'filemode disabled on the filesystem'
-else
-	test_set_prereq FILEMODE
-fi
diff --git a/t/t3701-add-interactive.sh b/t/t3701-add-interactive.sh
index 9dc91d0..24ddd8a 100755
--- a/t/t3701-add-interactive.sh
+++ b/t/t3701-add-interactive.sh
@@ -2,7 +2,6 @@
 
 test_description='add -i basic tests'
 . ./test-lib.sh
-. "$TEST_DIRECTORY"/lib-prereq-FILEMODE.sh
 
 if ! test_have_prereq PERL
 then
diff --git a/t/t4102-apply-rename.sh b/t/t4102-apply-rename.sh
index e3ea3d5..49e2d6c 100755
--- a/t/t4102-apply-rename.sh
+++ b/t/t4102-apply-rename.sh
@@ -7,7 +7,6 @@ test_description='git apply handling copy/rename patch.
 
 '
 . ./test-lib.sh
-. "$TEST_DIRECTORY"/lib-prereq-FILEMODE.sh
 
 # setup
 
diff --git a/t/t4120-apply-popt.sh b/t/t4120-apply-popt.sh
index c5fecdf..497b628 100755
--- a/t/t4120-apply-popt.sh
+++ b/t/t4120-apply-popt.sh
@@ -6,7 +6,6 @@
 test_description='git apply -p handling.'
 
 . ./test-lib.sh
-. "$TEST_DIRECTORY"/lib-prereq-FILEMODE.sh
 
 test_expect_success setup '
 	mkdir sub &&
diff --git a/t/t4129-apply-samemode.sh b/t/t4129-apply-samemode.sh
index 0d36ebd..c268298 100755
--- a/t/t4129-apply-samemode.sh
+++ b/t/t4129-apply-samemode.sh
@@ -3,7 +3,6 @@
 test_description='applying patch with mode bits'
 
 . ./test-lib.sh
-. "$TEST_DIRECTORY"/lib-prereq-FILEMODE.sh
 
 test_expect_success setup '
 	echo original >file &&
diff --git a/t/t6031-merge-recursive.sh b/t/t6031-merge-recursive.sh
index 1cd649e..a953f1b 100755
--- a/t/t6031-merge-recursive.sh
+++ b/t/t6031-merge-recursive.sh
@@ -2,7 +2,6 @@
 
 test_description='merge-recursive: handle file mode'
 . ./test-lib.sh
-. "$TEST_DIRECTORY"/lib-prereq-FILEMODE.sh
 
 test_expect_success 'mode change in one branch: keep changed version' '
 	: >file1 &&
diff --git a/t/t9200-git-cvsexportcommit.sh b/t/t9200-git-cvsexportcommit.sh
index 3fb3368..812c9cd 100755
--- a/t/t9200-git-cvsexportcommit.sh
+++ b/t/t9200-git-cvsexportcommit.sh
@@ -5,7 +5,6 @@
 test_description='Test export of commits to CVS'
 
 . ./test-lib.sh
-. "$TEST_DIRECTORY"/lib-prereq-FILEMODE.sh
 
 if ! test_have_prereq PERL; then
 	skip_all='skipping git cvsexportcommit tests, perl not available'
diff --git a/t/test-lib.sh b/t/test-lib.sh
index b25249e..5968157 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -830,6 +830,10 @@ test_lazy_prereq SYMLINKS '
 	ln -s x y && test -h y
 '
 
+test_lazy_prereq FILEMODE '
+	test "$(git config --bool core.filemode)" = true
+'
+
 test_lazy_prereq CASE_INSENSITIVE_FS '
 	echo good >CamelCase &&
 	echo bad >camelcase &&
-- 
1.8.4.1

  parent reply	other threads:[~2013-11-25 21:02 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-25 20:51 [PATCH 0/9] War on #! lines in shell libraries Jonathan Nieder
2013-11-25 20:52 ` [PATCH 1/9] mark Windows build scripts executable Jonathan Nieder
2013-11-25 20:53 ` [PATCH 2/9] mark perl test " Jonathan Nieder
2013-11-25 20:55 ` [PATCH 3/9] mark contributed hooks executable Jonathan Nieder
2013-11-25 20:58 ` [PATCH 4/9] contrib: remove git-p4import Jonathan Nieder
2013-11-26 12:31   ` Pete Wyckoff
2013-11-25 21:00 ` [PATCH 5/9 gitk] gitk: chmod +x po2msg Jonathan Nieder
2013-11-25 21:01 ` [PATCH 6/9 git-gui] git-gui: chmod +x po2msg, windows/git-gui.sh Jonathan Nieder
2013-11-25 21:02 ` Jonathan Nieder [this message]
2013-11-25 21:03 ` [PATCH 8/9] test: replace shebangs with descriptions in shell libraries Jonathan Nieder
2013-11-26  5:18   ` Eric Sunshine
2013-11-26 21:39     ` [PATCH 8/9 v2] " Jonathan Nieder
2013-11-25 21:03 ` [PATCH 9/9] remove #!interpreter line from " Jonathan Nieder

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=20131125210216.GX4212@google.com \
    --to=jrnieder@gmail.com \
    --cc=avarab@gmail.com \
    --cc=drizzd@aon.at \
    --cc=git@vger.kernel.org \
    --cc=marcnarc@xiplink.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).