[PATCH 00/10] More test suite prerequisite cleanup

STALE3732d

11 messages, 1 author, 2016-06-15 · open the first message on its own page

[PATCH 00/10] More test suite prerequisite cleanup

From: Ævar Arnfjörð Bjarmason <hidden>
Date: 2016-06-15 22:49:18

This series:

  * Moves the FILEMODE prerequisite test to lib-prereq-FILEMODE.sh
  * Continues the skip_all=* -> test prerequisite work. The patches to
    t/t9001-send-email.sh are in three parts for easier reviewing.
  * Adds a PERL prerequisite to tests that had an undeclared
    dependency on Perl via the -p switch.

This should take care of all the low hanging fruit skip_all=* wise,
what's left now either needs test-lib changes (the external tests), or
is a bit more hairy like the SVN, CVS and HTTP tests.

With this series these are the files still using skip_all=*:
    
    $ ack -l skip_all= *sh
    gitweb-lib.sh
    lib-cvs.sh
    lib-git-svn.sh
    lib-httpd.sh
    t0202-gettext-perl.sh
    t1509-root-worktree.sh
    t5540-http-push.sh
    t5541-http-push.sh
    t5550-http-fetch.sh
    t5551-http-fetch.sh
    t5561-http-backend.sh
    t9119-git-svn-info.sh
    t9200-git-cvsexportcommit.sh
    t9400-git-cvsserver-server.sh
    t9401-git-cvsserver-crlf.sh
    t9700-perl-git.sh
    test-lib.sh

Ævar Arnfjörð Bjarmason (10):
  tests: Move FILEMODE prerequisite to lib-prereq-FILEMODE.sh
  t/t3701-add-interactive.sh: change from skip_all=* to prereq skip
  lib-patch-mode tests: change from skip_all=* to prereq skip
  t/t9600-cvsimport.sh: change from skip_all=* to prereq skip
  t/t9001-send-email.sh: Remove needless PROG=* assignment
  t/t9001-send-email.sh: change from skip_all=* to prereq skip
  t/t9001-send-email.sh: convert setup code to tests
  t/t7105-reset-patch.sh: Add a PERL prerequisite
  t/t9601-cvsimport-vendor-branch.sh: Add a PERL prerequisite
  t/t9602-cvsimport-branches-tags.sh: Add a PERL prerequisite

 t/lib-patch-mode.sh                |    5 -
 t/lib-prereq-FILEMODE.sh           |   11 ++
 t/t2016-checkout-patch.sh          |   28 +++---
 t/t3701-add-interactive.sh         |  112 ++++++++++++-------
 t/t3904-stash-patch.sh             |   10 +-
 t/t4102-apply-rename.sh            |    8 +--
 t/t4129-apply-samemode.sh          |    8 +--
 t/t6031-merge-recursive.sh         |    6 +-
 t/t7105-reset-patch.sh             |   16 ++--
 t/t9001-send-email.sh              |  209 +++++++++++++++++++++---------------
 t/t9200-git-cvsexportcommit.sh     |    6 +-
 t/t9600-cvsimport.sh               |   39 +++----
 t/t9601-cvsimport-vendor-branch.sh |   24 +++--
 t/t9602-cvsimport-branches-tags.sh |   28 +++---
 14 files changed, 282 insertions(+), 228 deletions(-)
 create mode 100644 t/lib-prereq-FILEMODE.sh

-- 
1.7.2.1.338.gf2379

[PATCH 04/10] t/t9600-cvsimport.sh: change from skip_all=* to prereq skip

From: Ævar Arnfjörð Bjarmason <hidden>
Date: 2016-06-15 22:49:18

Change this test to skip test with test prerequisites, and to do setup
work in tests. This improves the skipped statistics on platforms where
the test isn't run.

Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
---
 t/t9600-cvsimport.sh |   39 ++++++++++++++++++---------------------
 1 files changed, 18 insertions(+), 21 deletions(-)
diff --git a/t/t9600-cvsimport.sh b/t/t9600-cvsimport.sh
index 2eff9cd..559ce41 100755
--- a/t/t9600-cvsimport.sh
+++ b/t/t9600-cvsimport.sh
@@ -3,17 +3,14 @@
 test_description='git cvsimport basic tests'
 . ./lib-cvs.sh
 
-if ! test_have_prereq PERL; then
-	skip_all='skipping git cvsimport tests, perl not available'
-	test_done
-fi
-
-CVSROOT=$(pwd)/cvsroot
-export CVSROOT
+test_expect_success PERL 'setup cvsroot environment' '
+	CVSROOT=$(pwd)/cvsroot &&
+	export CVSROOT
+'
 
-test_expect_success 'setup cvsroot' '$CVS init'
+test_expect_success PERL 'setup cvsroot' '$CVS init'
 
-test_expect_success 'setup a cvs module' '
+test_expect_success PERL 'setup a cvs module' '
 
 	mkdir "$CVSROOT/module" &&
 	$CVS co -d module-cvs module &&
@@ -45,23 +42,23 @@ EOF
 	cd ..
 '
 
-test_expect_success 'import a trivial module' '
+test_expect_success PERL 'import a trivial module' '
 
 	git cvsimport -a -R -z 0 -C module-git module &&
 	test_cmp module-cvs/o_fortuna module-git/o_fortuna
 
 '
 
-test_expect_success 'pack refs' 'cd module-git && git gc && cd ..'
+test_expect_success PERL 'pack refs' 'cd module-git && git gc && cd ..'
 
-test_expect_success 'initial import has correct .git/cvs-revisions' '
+test_expect_success PERL 'initial import has correct .git/cvs-revisions' '
 
 	(cd module-git &&
 	 git log --format="o_fortuna 1.1 %H" -1) > expected &&
 	test_cmp expected module-git/.git/cvs-revisions
 '
 
-test_expect_success 'update cvs module' '
+test_expect_success PERL 'update cvs module' '
 
 	cd module-cvs &&
 	cat <<EOF >o_fortuna &&
@@ -90,7 +87,7 @@ EOF
 	cd ..
 '
 
-test_expect_success 'update git module' '
+test_expect_success PERL 'update git module' '
 
 	cd module-git &&
 	git cvsimport -a -R -z 0 module &&
@@ -100,7 +97,7 @@ test_expect_success 'update git module' '
 
 '
 
-test_expect_success 'update has correct .git/cvs-revisions' '
+test_expect_success PERL 'update has correct .git/cvs-revisions' '
 
 	(cd module-git &&
 	 git log --format="o_fortuna 1.1 %H" -1 HEAD^ &&
@@ -108,7 +105,7 @@ test_expect_success 'update has correct .git/cvs-revisions' '
 	test_cmp expected module-git/.git/cvs-revisions
 '
 
-test_expect_success 'update cvs module' '
+test_expect_success PERL 'update cvs module' '
 
 	cd module-cvs &&
 		echo 1 >tick &&
@@ -118,7 +115,7 @@ test_expect_success 'update cvs module' '
 
 '
 
-test_expect_success 'cvsimport.module config works' '
+test_expect_success PERL 'cvsimport.module config works' '
 
 	cd module-git &&
 		git config cvsimport.module module &&
@@ -129,7 +126,7 @@ test_expect_success 'cvsimport.module config works' '
 
 '
 
-test_expect_success 'second update has correct .git/cvs-revisions' '
+test_expect_success PERL 'second update has correct .git/cvs-revisions' '
 
 	(cd module-git &&
 	 git log --format="o_fortuna 1.1 %H" -1 HEAD^^ &&
@@ -138,7 +135,7 @@ test_expect_success 'second update has correct .git/cvs-revisions' '
 	test_cmp expected module-git/.git/cvs-revisions
 '
 
-test_expect_success 'import from a CVS working tree' '
+test_expect_success PERL 'import from a CVS working tree' '
 
 	$CVS co -d import-from-wt module &&
 	cd import-from-wt &&
@@ -150,12 +147,12 @@ test_expect_success 'import from a CVS working tree' '
 
 '
 
-test_expect_success 'no .git/cvs-revisions created by default' '
+test_expect_success PERL 'no .git/cvs-revisions created by default' '
 
 	! test -e import-from-wt/.git/cvs-revisions
 
 '
 
-test_expect_success 'test entire HEAD' 'test_cmp_branch_tree master'
+test_expect_success PERL 'test entire HEAD' 'test_cmp_branch_tree master'
 
 test_done
-- 
1.7.2.1.338.gf2379

[PATCH 06/10] t/t9001-send-email.sh: change from skip_all=* to prereq skip

From: Ævar Arnfjörð Bjarmason <hidden>
Date: 2016-06-15 22:49:18

Change this test to skip test with test prerequisites, and to do setup
work in tests. This improves the skipped statistics on platforms where
the test isn't run.

Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
---
 t/t9001-send-email.sh |  165 +++++++++++++++++++++++++------------------------
 1 files changed, 83 insertions(+), 82 deletions(-)
diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh
index 6525d1d..bd17d31 100755
--- a/t/t9001-send-email.sh
+++ b/t/t9001-send-email.sh
@@ -3,19 +3,17 @@
 test_description='git send-email'
 . ./test-lib.sh
 
-if ! test_have_prereq PERL; then
-	skip_all='skipping git send-email tests, perl not available'
-	test_done
-fi
+# May be altered later in the test
+PREREQ="PERL"
 
-test_expect_success \
+test_expect_success $PREREQ \
     'prepare reference tree' \
     'echo "1A quick brown fox jumps over the" >file &&
      echo "lazy dog" >>file &&
      git add file &&
      GIT_AUTHOR_NAME="A" git commit -a -m "Initial."'
 
-test_expect_success \
+test_expect_success $PREREQ \
     'Setup helper tool' \
     '(echo "#!$SHELL_PATH"
       echo shift
@@ -35,7 +33,7 @@ clean_fake_sendmail() {
 	rm -f commandline* msgtxt*
 }
 
-test_expect_success 'Extract patches' '
+test_expect_success $PREREQ 'Extract patches' '
     patches=`git format-patch -s --cc="One <one@example.com>" --cc=two@example.com -n HEAD^1`
 '
 
@@ -56,31 +54,34 @@ test_no_confirm () {
 
 # Exit immediately to prevent hang if a no-confirm test fails
 check_no_confirm () {
-	test -f no_confirm_okay || {
-		skip_all='confirm test failed; skipping remaining tests to prevent hanging'
-		test_done
-	}
+	if ! test -f no_confirm_okay
+	then
+		say 'confirm test failed; skipping remaining tests to prevent hanging'
+		PREREQ="$PREREQ,CHECK_NO_CONFIRM"
+	fi
+	return 0
 }
 
-test_expect_success 'No confirm with --suppress-cc' '
-	test_no_confirm --suppress-cc=sob
+test_expect_success $PREREQ 'No confirm with --suppress-cc' '
+	test_no_confirm --suppress-cc=sob &&
+	check_no_confirm
 '
-check_no_confirm
 
-test_expect_success 'No confirm with --confirm=never' '
-	test_no_confirm --confirm=never
+
+test_expect_success $PREREQ 'No confirm with --confirm=never' '
+	test_no_confirm --confirm=never &&
+	check_no_confirm
 '
-check_no_confirm
 
 # leave sendemail.confirm set to never after this so that none of the
 # remaining tests prompt unintentionally.
-test_expect_success 'No confirm with sendemail.confirm=never' '
+test_expect_success $PREREQ 'No confirm with sendemail.confirm=never' '
 	git config sendemail.confirm never &&
-	test_no_confirm --compose --subject=foo
+	test_no_confirm --compose --subject=foo &&
+	check_no_confirm
 '
-check_no_confirm
 
-test_expect_success 'Send patches' '
+test_expect_success $PREREQ 'Send patches' '
      git send-email --suppress-cc=sob --from="Example <nobody@example.com>" --to=nobody@example.com --smtp-server="$(pwd)/fake.sendmail" $patches 2>errors
 '
 
@@ -90,11 +91,11 @@ cat >expected <<\EOF
 !one@example.com!
 !two@example.com!
 EOF
-test_expect_success \
+test_expect_success $PREREQ \
     'Verify commandline' \
     'test_cmp expected commandline1'
 
-test_expect_success 'Send patches with --envelope-sender' '
+test_expect_success $PREREQ 'Send patches with --envelope-sender' '
     clean_fake_sendmail &&
      git send-email --envelope-sender="Patch Contributer <patch@example.com>" --suppress-cc=sob --from="Example <nobody@example.com>" --to=nobody@example.com --smtp-server="$(pwd)/fake.sendmail" $patches 2>errors
 '
@@ -107,11 +108,11 @@ cat >expected <<\EOF
 !one@example.com!
 !two@example.com!
 EOF
-test_expect_success \
+test_expect_success $PREREQ \
     'Verify commandline' \
     'test_cmp expected commandline1'
 
-test_expect_success 'Send patches with --envelope-sender=auto' '
+test_expect_success $PREREQ 'Send patches with --envelope-sender=auto' '
     clean_fake_sendmail &&
      git send-email --envelope-sender=auto --suppress-cc=sob --from="Example <nobody@example.com>" --to=nobody@example.com --smtp-server="$(pwd)/fake.sendmail" $patches 2>errors
 '
@@ -124,7 +125,7 @@ cat >expected <<\EOF
 !one@example.com!
 !two@example.com!
 EOF
-test_expect_success \
+test_expect_success $PREREQ \
     'Verify commandline' \
     'test_cmp expected commandline1'
 
@@ -158,7 +159,7 @@ References: <unique-message-id@example.com>
 Result: OK
 EOF
 
-test_expect_success 'Show all headers' '
+test_expect_success $PREREQ 'Show all headers' '
 	git send-email \
 		--dry-run \
 		--suppress-cc=sob \
@@ -176,7 +177,7 @@ test_expect_success 'Show all headers' '
 	test_cmp expected-show-all-headers actual-show-all-headers
 '
 
-test_expect_success 'Prompting works' '
+test_expect_success $PREREQ 'Prompting works' '
 	clean_fake_sendmail &&
 	(echo "Example <from@example.com>"
 	 echo "to@example.com"
@@ -189,7 +190,7 @@ test_expect_success 'Prompting works' '
 		grep "^To: to@example.com\$" msgtxt1
 '
 
-test_expect_success 'cccmd works' '
+test_expect_success $PREREQ 'cccmd works' '
 	clean_fake_sendmail &&
 	cp $patches cccmd.patch &&
 	echo cccmd--cccmd@example.com >>cccmd.patch &&
@@ -211,7 +212,7 @@ test_expect_success 'cccmd works' '
 z8=zzzzzzzz
 z64=$z8$z8$z8$z8$z8$z8$z8$z8
 z512=$z64$z64$z64$z64$z64$z64$z64$z64
-test_expect_success 'reject long lines' '
+test_expect_success $PREREQ 'reject long lines' '
 	clean_fake_sendmail &&
 	cp $patches longline.patch &&
 	echo $z512$z512 >>longline.patch &&
@@ -224,11 +225,11 @@ test_expect_success 'reject long lines' '
 	grep longline.patch errors
 '
 
-test_expect_success 'no patch was sent' '
+test_expect_success $PREREQ 'no patch was sent' '
 	! test -e commandline1
 '
 
-test_expect_success 'Author From: in message body' '
+test_expect_success $PREREQ 'Author From: in message body' '
 	clean_fake_sendmail &&
 	git send-email \
 		--from="Example <nobody@example.com>" \
@@ -239,7 +240,7 @@ test_expect_success 'Author From: in message body' '
 	grep "From: A <author@example.com>" msgbody1
 '
 
-test_expect_success 'Author From: not in message body' '
+test_expect_success $PREREQ 'Author From: not in message body' '
 	clean_fake_sendmail &&
 	git send-email \
 		--from="A <author@example.com>" \
@@ -250,7 +251,7 @@ test_expect_success 'Author From: not in message body' '
 	! grep "From: A <author@example.com>" msgbody1
 '
 
-test_expect_success 'allow long lines with --no-validate' '
+test_expect_success $PREREQ 'allow long lines with --no-validate' '
 	git send-email \
 		--from="Example <nobody@example.com>" \
 		--to=nobody@example.com \
@@ -260,7 +261,7 @@ test_expect_success 'allow long lines with --no-validate' '
 		2>errors
 '
 
-test_expect_success 'Invalid In-Reply-To' '
+test_expect_success $PREREQ 'Invalid In-Reply-To' '
 	clean_fake_sendmail &&
 	git send-email \
 		--from="Example <nobody@example.com>" \
@@ -272,7 +273,7 @@ test_expect_success 'Invalid In-Reply-To' '
 	! grep "^In-Reply-To: < *>" msgtxt1
 '
 
-test_expect_success 'Valid In-Reply-To when prompting' '
+test_expect_success $PREREQ 'Valid In-Reply-To when prompting' '
 	clean_fake_sendmail &&
 	(echo "From Example <from@example.com>"
 	 echo "To Example <to@example.com>"
@@ -283,7 +284,7 @@ test_expect_success 'Valid In-Reply-To when prompting' '
 	! grep "^In-Reply-To: < *>" msgtxt1
 '
 
-test_expect_success 'setup fake editor' '
+test_expect_success $PREREQ 'setup fake editor' '
 	(echo "#!$SHELL_PATH" &&
 	 echo "echo fake edit >>\"\$1\""
 	) >fake-editor &&
@@ -292,7 +293,7 @@ test_expect_success 'setup fake editor' '
 
 test_set_editor "$(pwd)/fake-editor"
 
-test_expect_success '--compose works' '
+test_expect_success $PREREQ '--compose works' '
 	clean_fake_sendmail &&
 	git send-email \
 	--compose --subject foo \
@@ -303,11 +304,11 @@ test_expect_success '--compose works' '
 	2>errors
 '
 
-test_expect_success 'first message is compose text' '
+test_expect_success $PREREQ 'first message is compose text' '
 	grep "^fake edit" msgtxt1
 '
 
-test_expect_success 'second message is patch' '
+test_expect_success $PREREQ 'second message is patch' '
 	grep "Subject:.*Second" msgtxt2
 '
 
@@ -353,7 +354,7 @@ test_suppression () {
 	test_cmp expected-suppress-$1${2+"-$2"} actual-suppress-$1${2+"-$2"}
 }
 
-test_expect_success 'sendemail.cc set' '
+test_expect_success $PREREQ 'sendemail.cc set' '
 	git config sendemail.cc cc@example.com &&
 	test_suppression sob
 '
@@ -383,7 +384,7 @@ X-Mailer: X-MAILER-STRING
 Result: OK
 EOF
 
-test_expect_success 'sendemail.cc unset' '
+test_expect_success $PREREQ 'sendemail.cc unset' '
 	git config --unset sendemail.cc &&
 	test_suppression sob
 '
@@ -416,7 +417,7 @@ X-Mailer: X-MAILER-STRING
 Result: OK
 EOF
 
-test_expect_success 'sendemail.cccmd' '
+test_expect_success $PREREQ 'sendemail.cccmd' '
 	echo echo cc-cmd@example.com > cccmd &&
 	chmod +x cccmd &&
 	git config sendemail.cccmd ./cccmd &&
@@ -439,7 +440,7 @@ X-Mailer: X-MAILER-STRING
 Result: OK
 EOF
 
-test_expect_success '--suppress-cc=all' '
+test_expect_success $PREREQ '--suppress-cc=all' '
 	test_suppression all
 '
 
@@ -471,7 +472,7 @@ X-Mailer: X-MAILER-STRING
 Result: OK
 EOF
 
-test_expect_success '--suppress-cc=body' '
+test_expect_success $PREREQ '--suppress-cc=body' '
 	test_suppression body
 '
 
@@ -500,7 +501,7 @@ X-Mailer: X-MAILER-STRING
 Result: OK
 EOF
 
-test_expect_success '--suppress-cc=body --suppress-cc=cccmd' '
+test_expect_success $PREREQ '--suppress-cc=body --suppress-cc=cccmd' '
 	test_suppression body cccmd
 '
 
@@ -529,7 +530,7 @@ X-Mailer: X-MAILER-STRING
 Result: OK
 EOF
 
-test_expect_success '--suppress-cc=sob' '
+test_expect_success $PREREQ '--suppress-cc=sob' '
 	git config --unset sendemail.cccmd
 	test_suppression sob
 '
@@ -562,7 +563,7 @@ X-Mailer: X-MAILER-STRING
 Result: OK
 EOF
 
-test_expect_success '--suppress-cc=bodycc' '
+test_expect_success $PREREQ '--suppress-cc=bodycc' '
 	test_suppression bodycc
 '
 
@@ -588,7 +589,7 @@ X-Mailer: X-MAILER-STRING
 Result: OK
 EOF
 
-test_expect_success '--suppress-cc=cc' '
+test_expect_success $PREREQ '--suppress-cc=cc' '
 	test_suppression cc
 '
 
@@ -603,23 +604,23 @@ test_confirm () {
 	grep "Send this email" stdout
 }
 
-test_expect_success '--confirm=always' '
+test_expect_success $PREREQ '--confirm=always' '
 	test_confirm --confirm=always --suppress-cc=all
 '
 
-test_expect_success '--confirm=auto' '
+test_expect_success $PREREQ '--confirm=auto' '
 	test_confirm --confirm=auto
 '
 
-test_expect_success '--confirm=cc' '
+test_expect_success $PREREQ '--confirm=cc' '
 	test_confirm --confirm=cc
 '
 
-test_expect_success '--confirm=compose' '
+test_expect_success $PREREQ '--confirm=compose' '
 	test_confirm --confirm=compose --compose
 '
 
-test_expect_success 'confirm by default (due to cc)' '
+test_expect_success $PREREQ 'confirm by default (due to cc)' '
 	CONFIRM=$(git config --get sendemail.confirm) &&
 	git config --unset sendemail.confirm &&
 	test_confirm
@@ -628,7 +629,7 @@ test_expect_success 'confirm by default (due to cc)' '
 	test $ret = "0"
 '
 
-test_expect_success 'confirm by default (due to --compose)' '
+test_expect_success $PREREQ 'confirm by default (due to --compose)' '
 	CONFIRM=$(git config --get sendemail.confirm) &&
 	git config --unset sendemail.confirm &&
 	test_confirm --suppress-cc=all --compose
@@ -637,7 +638,7 @@ test_expect_success 'confirm by default (due to --compose)' '
 	test $ret = "0"
 '
 
-test_expect_success 'confirm detects EOF (inform assumes y)' '
+test_expect_success $PREREQ 'confirm detects EOF (inform assumes y)' '
 	CONFIRM=$(git config --get sendemail.confirm) &&
 	git config --unset sendemail.confirm &&
 	rm -fr outdir &&
@@ -653,7 +654,7 @@ test_expect_success 'confirm detects EOF (inform assumes y)' '
 	test $ret = "0"
 '
 
-test_expect_success 'confirm detects EOF (auto causes failure)' '
+test_expect_success $PREREQ 'confirm detects EOF (auto causes failure)' '
 	CONFIRM=$(git config --get sendemail.confirm) &&
 	git config sendemail.confirm auto &&
 	GIT_SEND_EMAIL_NOTTY=1 &&
@@ -668,7 +669,7 @@ test_expect_success 'confirm detects EOF (auto causes failure)' '
 	test $ret = "0"
 '
 
-test_expect_success 'confirm doesnt loop forever' '
+test_expect_success $PREREQ 'confirm doesnt loop forever' '
 	CONFIRM=$(git config --get sendemail.confirm) &&
 	git config sendemail.confirm auto &&
 	GIT_SEND_EMAIL_NOTTY=1 &&
@@ -683,7 +684,7 @@ test_expect_success 'confirm doesnt loop forever' '
 	test $ret = "0"
 '
 
-test_expect_success 'utf8 Cc is rfc2047 encoded' '
+test_expect_success $PREREQ 'utf8 Cc is rfc2047 encoded' '
 	clean_fake_sendmail &&
 	rm -fr outdir &&
 	git format-patch -1 -o outdir --cc="àéìöú <utf8@example.com>" &&
@@ -696,7 +697,7 @@ test_expect_success 'utf8 Cc is rfc2047 encoded' '
 	grep "=?UTF-8?q?=C3=A0=C3=A9=C3=AC=C3=B6=C3=BA?= <utf8@example.com>"
 '
 
-test_expect_success '--compose adds MIME for utf8 body' '
+test_expect_success $PREREQ '--compose adds MIME for utf8 body' '
 	clean_fake_sendmail &&
 	(echo "#!$SHELL_PATH" &&
 	 echo "echo utf8 body: àéìöú >>\"\$1\""
@@ -713,7 +714,7 @@ test_expect_success '--compose adds MIME for utf8 body' '
 	grep "^Content-Type: text/plain; charset=UTF-8" msgtxt1
 '
 
-test_expect_success '--compose respects user mime type' '
+test_expect_success $PREREQ '--compose respects user mime type' '
 	clean_fake_sendmail &&
 	(echo "#!$SHELL_PATH" &&
 	 echo "(echo MIME-Version: 1.0"
@@ -736,7 +737,7 @@ test_expect_success '--compose respects user mime type' '
 	! grep "^Content-Type: text/plain; charset=UTF-8" msgtxt1
 '
 
-test_expect_success '--compose adds MIME for utf8 subject' '
+test_expect_success $PREREQ '--compose adds MIME for utf8 subject' '
 	clean_fake_sendmail &&
 	  GIT_EDITOR="\"$(pwd)/fake-editor\"" \
 	  git send-email \
@@ -749,7 +750,7 @@ test_expect_success '--compose adds MIME for utf8 subject' '
 	grep "^Subject: =?UTF-8?q?utf8-s=C3=BCbj=C3=ABct?=" msgtxt1
 '
 
-test_expect_success 'detects ambiguous reference/file conflict' '
+test_expect_success $PREREQ 'detects ambiguous reference/file conflict' '
 	echo master > master &&
 	git add master &&
 	git commit -m"add master" &&
@@ -757,7 +758,7 @@ test_expect_success 'detects ambiguous reference/file conflict' '
 	grep disambiguate errors
 '
 
-test_expect_success 'feed two files' '
+test_expect_success $PREREQ 'feed two files' '
 	rm -fr outdir &&
 	git format-patch -2 -o outdir &&
 	git send-email \
@@ -770,7 +771,7 @@ test_expect_success 'feed two files' '
 	test "z$(sed -n -e 2p subjects)" = "zSubject: [PATCH 2/2] add master"
 '
 
-test_expect_success 'in-reply-to but no threading' '
+test_expect_success $PREREQ 'in-reply-to but no threading' '
 	git send-email \
 		--dry-run \
 		--from="Example <nobody@example.com>" \
@@ -781,7 +782,7 @@ test_expect_success 'in-reply-to but no threading' '
 	grep "In-Reply-To: <in-reply-id@example.com>"
 '
 
-test_expect_success 'no in-reply-to and no threading' '
+test_expect_success $PREREQ 'no in-reply-to and no threading' '
 	git send-email \
 		--dry-run \
 		--from="Example <nobody@example.com>" \
@@ -791,7 +792,7 @@ test_expect_success 'no in-reply-to and no threading' '
 	! grep "In-Reply-To: " stdout
 '
 
-test_expect_success 'threading but no chain-reply-to' '
+test_expect_success $PREREQ 'threading but no chain-reply-to' '
 	git send-email \
 		--dry-run \
 		--from="Example <nobody@example.com>" \
@@ -802,7 +803,7 @@ test_expect_success 'threading but no chain-reply-to' '
 	grep "In-Reply-To: " stdout
 '
 
-test_expect_success 'warning with an implicit --chain-reply-to' '
+test_expect_success $PREREQ 'warning with an implicit --chain-reply-to' '
 	git send-email \
 	--dry-run \
 	--from="Example <nobody@example.com>" \
@@ -811,7 +812,7 @@ test_expect_success 'warning with an implicit --chain-reply-to' '
 	grep "no-chain-reply-to" errors
 '
 
-test_expect_success 'no warning with an explicit --chain-reply-to' '
+test_expect_success $PREREQ 'no warning with an explicit --chain-reply-to' '
 	git send-email \
 	--dry-run \
 	--from="Example <nobody@example.com>" \
@@ -821,7 +822,7 @@ test_expect_success 'no warning with an explicit --chain-reply-to' '
 	! grep "no-chain-reply-to" errors
 '
 
-test_expect_success 'no warning with an explicit --no-chain-reply-to' '
+test_expect_success $PREREQ 'no warning with an explicit --no-chain-reply-to' '
 	git send-email \
 	--dry-run \
 	--from="Example <nobody@example.com>" \
@@ -831,7 +832,7 @@ test_expect_success 'no warning with an explicit --no-chain-reply-to' '
 	! grep "no-chain-reply-to" errors
 '
 
-test_expect_success 'no warning with sendemail.chainreplyto = false' '
+test_expect_success $PREREQ 'no warning with sendemail.chainreplyto = false' '
 	git config sendemail.chainreplyto false &&
 	git send-email \
 	--dry-run \
@@ -841,7 +842,7 @@ test_expect_success 'no warning with sendemail.chainreplyto = false' '
 	! grep "no-chain-reply-to" errors
 '
 
-test_expect_success 'no warning with sendemail.chainreplyto = true' '
+test_expect_success $PREREQ 'no warning with sendemail.chainreplyto = true' '
 	git config sendemail.chainreplyto true &&
 	git send-email \
 	--dry-run \
@@ -851,7 +852,7 @@ test_expect_success 'no warning with sendemail.chainreplyto = true' '
 	! grep "no-chain-reply-to" errors
 '
 
-test_expect_success 'sendemail.to works' '
+test_expect_success $PREREQ 'sendemail.to works' '
 	git config --replace-all sendemail.to "Somebody <somebody@ex.com>" &&
 	git send-email \
 		--dry-run \
@@ -860,7 +861,7 @@ test_expect_success 'sendemail.to works' '
 	grep "To: Somebody <somebody@ex.com>" stdout
 '
 
-test_expect_success '--no-to overrides sendemail.to' '
+test_expect_success $PREREQ '--no-to overrides sendemail.to' '
 	git send-email \
 		--dry-run \
 		--from="Example <nobody@example.com>" \
@@ -871,7 +872,7 @@ test_expect_success '--no-to overrides sendemail.to' '
 	! grep "To: Somebody <somebody@ex.com>" stdout
 '
 
-test_expect_success 'sendemail.cc works' '
+test_expect_success $PREREQ 'sendemail.cc works' '
 	git config --replace-all sendemail.cc "Somebody <somebody@ex.com>" &&
 	git send-email \
 		--dry-run \
@@ -881,7 +882,7 @@ test_expect_success 'sendemail.cc works' '
 	grep "Cc: Somebody <somebody@ex.com>" stdout
 '
 
-test_expect_success '--no-cc overrides sendemail.cc' '
+test_expect_success $PREREQ '--no-cc overrides sendemail.cc' '
 	git send-email \
 		--dry-run \
 		--from="Example <nobody@example.com>" \
@@ -893,7 +894,7 @@ test_expect_success '--no-cc overrides sendemail.cc' '
 	! grep "Cc: Somebody <somebody@ex.com>" stdout
 '
 
-test_expect_success 'sendemail.bcc works' '
+test_expect_success $PREREQ 'sendemail.bcc works' '
 	git config --replace-all sendemail.bcc "Other <other@ex.com>" &&
 	git send-email \
 		--dry-run \
@@ -904,7 +905,7 @@ test_expect_success 'sendemail.bcc works' '
 	grep "RCPT TO:<other@ex.com>" stdout
 '
 
-test_expect_success '--no-bcc overrides sendemail.bcc' '
+test_expect_success $PREREQ '--no-bcc overrides sendemail.bcc' '
 	git send-email \
 		--dry-run \
 		--from="Example <nobody@example.com>" \
@@ -933,7 +934,7 @@ Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: 8bit
 EOF
 
-test_expect_success 'asks about and fixes 8bit encodings' '
+test_expect_success $PREREQ 'asks about and fixes 8bit encodings' '
 	clean_fake_sendmail &&
 	echo |
 	git send-email --from=author@example.com --to=nobody@example.com \
@@ -946,7 +947,7 @@ test_expect_success 'asks about and fixes 8bit encodings' '
 	test_cmp actual content-type-decl
 '
 
-test_expect_success 'sendemail.8bitEncoding works' '
+test_expect_success $PREREQ 'sendemail.8bitEncoding works' '
 	clean_fake_sendmail &&
 	git config sendemail.assume8bitEncoding UTF-8 &&
 	echo bogus |
@@ -957,7 +958,7 @@ test_expect_success 'sendemail.8bitEncoding works' '
 	test_cmp actual content-type-decl
 '
 
-test_expect_success '--8bit-encoding overrides sendemail.8bitEncoding' '
+test_expect_success $PREREQ '--8bit-encoding overrides sendemail.8bitEncoding' '
 	clean_fake_sendmail &&
 	git config sendemail.assume8bitEncoding "bogus too" &&
 	echo bogus |
@@ -983,7 +984,7 @@ cat >expected <<EOF
 Subject: =?UTF-8?q?Dieser=20Betreff=20enth=C3=A4lt=20auch=20einen=20Umlaut!?=
 EOF
 
-test_expect_success '--8bit-encoding also treats subject' '
+test_expect_success $PREREQ '--8bit-encoding also treats subject' '
 	clean_fake_sendmail &&
 	echo bogus |
 	git send-email --from=author@example.com --to=nobody@example.com \
-- 
1.7.2.1.338.gf2379

[PATCH 08/10] t/t7105-reset-patch.sh: Add a PERL prerequisite

From: Ævar Arnfjörð Bjarmason <hidden>
Date: 2016-06-15 22:49:18

Change this test to declare a PERL prerequisite. These tests use the
-p switch, so they implicitly depend on Perl code, but nothing was
declaring this.

Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
---
 t/t7105-reset-patch.sh |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/t/t7105-reset-patch.sh b/t/t7105-reset-patch.sh
index 4b629f7..9891e2c 100755
--- a/t/t7105-reset-patch.sh
+++ b/t/t7105-reset-patch.sh
@@ -3,7 +3,7 @@
 test_description='git reset --patch'
 . ./lib-patch-mode.sh
 
-test_expect_success 'setup' '
+test_expect_success PERL 'setup' '
 	mkdir dir &&
 	echo parent > dir/foo &&
 	echo dummy > bar &&
@@ -17,20 +17,20 @@ test_expect_success 'setup' '
 
 # note: bar sorts before foo, so the first 'n' is always to skip 'bar'
 
-test_expect_success 'saying "n" does nothing' '
+test_expect_success PERL 'saying "n" does nothing' '
 	set_and_save_state dir/foo work work
 	(echo n; echo n) | git reset -p &&
 	verify_saved_state dir/foo &&
 	verify_saved_state bar
 '
 
-test_expect_success 'git reset -p' '
+test_expect_success PERL 'git reset -p' '
 	(echo n; echo y) | git reset -p &&
 	verify_state dir/foo work head &&
 	verify_saved_state bar
 '
 
-test_expect_success 'git reset -p HEAD^' '
+test_expect_success PERL 'git reset -p HEAD^' '
 	(echo n; echo y) | git reset -p HEAD^ &&
 	verify_state dir/foo work parent &&
 	verify_saved_state bar
-- 
1.7.2.1.338.gf2379

[PATCH 07/10] t/t9001-send-email.sh: convert setup code to tests

From: Ævar Arnfjörð Bjarmason <hidden>
Date: 2016-06-15 22:49:18

Change the setup code in t/t9001-send-email.sh to use
test_expect_success. This way it isn't needlessly run in environments
where the test prerequisites aren't met.

Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
---
 t/t9001-send-email.sh |   43 ++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 40 insertions(+), 3 deletions(-)
diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh
index bd17d31..71b3df9 100755
--- a/t/t9001-send-email.sh
+++ b/t/t9001-send-email.sh
@@ -85,12 +85,15 @@ test_expect_success $PREREQ 'Send patches' '
      git send-email --suppress-cc=sob --from="Example <nobody@example.com>" --to=nobody@example.com --smtp-server="$(pwd)/fake.sendmail" $patches 2>errors
 '
 
+test_expect_success $PREREQ 'setup expect' '
 cat >expected <<\EOF
 !nobody@example.com!
 !author@example.com!
 !one@example.com!
 !two@example.com!
 EOF
+'
+
 test_expect_success $PREREQ \
     'Verify commandline' \
     'test_cmp expected commandline1'
@@ -100,6 +103,7 @@ test_expect_success $PREREQ 'Send patches with --envelope-sender' '
      git send-email --envelope-sender="Patch Contributer <patch@example.com>" --suppress-cc=sob --from="Example <nobody@example.com>" --to=nobody@example.com --smtp-server="$(pwd)/fake.sendmail" $patches 2>errors
 '
 
+test_expect_success $PREREQ 'setup expect' '
 cat >expected <<\EOF
 !patch@example.com!
 !-i!
@@ -108,6 +112,8 @@ cat >expected <<\EOF
 !one@example.com!
 !two@example.com!
 EOF
+'
+
 test_expect_success $PREREQ \
     'Verify commandline' \
     'test_cmp expected commandline1'
@@ -117,6 +123,7 @@ test_expect_success $PREREQ 'Send patches with --envelope-sender=auto' '
      git send-email --envelope-sender=auto --suppress-cc=sob --from="Example <nobody@example.com>" --to=nobody@example.com --smtp-server="$(pwd)/fake.sendmail" $patches 2>errors
 '
 
+test_expect_success $PREREQ 'setup expect' '
 cat >expected <<\EOF
 !nobody@example.com!
 !-i!
@@ -125,10 +132,13 @@ cat >expected <<\EOF
 !one@example.com!
 !two@example.com!
 EOF
+'
+
 test_expect_success $PREREQ \
     'Verify commandline' \
     'test_cmp expected commandline1'
 
+test_expect_success $PREREQ 'setup expect' "
 cat >expected-show-all-headers <<\EOF
 0001-Second.patch
 (mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'
@@ -158,6 +168,7 @@ References: <unique-message-id@example.com>
 
 Result: OK
 EOF
+"
 
 test_expect_success $PREREQ 'Show all headers' '
 	git send-email \
@@ -209,10 +220,10 @@ test_expect_success $PREREQ 'cccmd works' '
 	grep "^	cccmd@example.com" msgtxt1
 '
 
-z8=zzzzzzzz
-z64=$z8$z8$z8$z8$z8$z8$z8$z8
-z512=$z64$z64$z64$z64$z64$z64$z64$z64
 test_expect_success $PREREQ 'reject long lines' '
+	z8=zzzzzzzz &&
+	z64=$z8$z8$z8$z8$z8$z8$z8$z8 &&
+	z512=$z64$z64$z64$z64$z64$z64$z64$z64 &&
 	clean_fake_sendmail &&
 	cp $patches longline.patch &&
 	echo $z512$z512 >>longline.patch &&
@@ -312,6 +323,7 @@ test_expect_success $PREREQ 'second message is patch' '
 	grep "Subject:.*Second" msgtxt2
 '
 
+test_expect_success $PREREQ 'setup expect' "
 cat >expected-suppress-sob <<\EOF
 0001-Second.patch
 (mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'
@@ -338,6 +350,7 @@ X-Mailer: X-MAILER-STRING
 
 Result: OK
 EOF
+"
 
 test_suppression () {
 	git send-email \
@@ -359,6 +372,7 @@ test_expect_success $PREREQ 'sendemail.cc set' '
 	test_suppression sob
 '
 
+test_expect_success $PREREQ 'setup expect' "
 cat >expected-suppress-sob <<\EOF
 0001-Second.patch
 (mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'
@@ -383,12 +397,14 @@ X-Mailer: X-MAILER-STRING
 
 Result: OK
 EOF
+"
 
 test_expect_success $PREREQ 'sendemail.cc unset' '
 	git config --unset sendemail.cc &&
 	test_suppression sob
 '
 
+test_expect_success $PREREQ 'setup expect' "
 cat >expected-suppress-cccmd <<\EOF
 0001-Second.patch
 (mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'
@@ -416,6 +432,7 @@ X-Mailer: X-MAILER-STRING
 
 Result: OK
 EOF
+"
 
 test_expect_success $PREREQ 'sendemail.cccmd' '
 	echo echo cc-cmd@example.com > cccmd &&
@@ -424,6 +441,7 @@ test_expect_success $PREREQ 'sendemail.cccmd' '
 	test_suppression cccmd
 '
 
+test_expect_success $PREREQ 'setup expect' '
 cat >expected-suppress-all <<\EOF
 0001-Second.patch
 Dry-OK. Log says:
@@ -439,11 +457,13 @@ X-Mailer: X-MAILER-STRING
 
 Result: OK
 EOF
+'
 
 test_expect_success $PREREQ '--suppress-cc=all' '
 	test_suppression all
 '
 
+test_expect_success $PREREQ 'setup expect' "
 cat >expected-suppress-body <<\EOF
 0001-Second.patch
 (mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'
@@ -471,11 +491,13 @@ X-Mailer: X-MAILER-STRING
 
 Result: OK
 EOF
+"
 
 test_expect_success $PREREQ '--suppress-cc=body' '
 	test_suppression body
 '
 
+test_expect_success $PREREQ 'setup expect' "
 cat >expected-suppress-body-cccmd <<\EOF
 0001-Second.patch
 (mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'
@@ -500,11 +522,13 @@ X-Mailer: X-MAILER-STRING
 
 Result: OK
 EOF
+"
 
 test_expect_success $PREREQ '--suppress-cc=body --suppress-cc=cccmd' '
 	test_suppression body cccmd
 '
 
+test_expect_success $PREREQ 'setup expect' "
 cat >expected-suppress-sob <<\EOF
 0001-Second.patch
 (mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'
@@ -529,12 +553,14 @@ X-Mailer: X-MAILER-STRING
 
 Result: OK
 EOF
+"
 
 test_expect_success $PREREQ '--suppress-cc=sob' '
 	git config --unset sendemail.cccmd
 	test_suppression sob
 '
 
+test_expect_success $PREREQ 'setup expect' "
 cat >expected-suppress-bodycc <<\EOF
 0001-Second.patch
 (mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'
@@ -562,11 +588,13 @@ X-Mailer: X-MAILER-STRING
 
 Result: OK
 EOF
+"
 
 test_expect_success $PREREQ '--suppress-cc=bodycc' '
 	test_suppression bodycc
 '
 
+test_expect_success $PREREQ 'setup expect' "
 cat >expected-suppress-cc <<\EOF
 0001-Second.patch
 (mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'
@@ -588,6 +616,7 @@ X-Mailer: X-MAILER-STRING
 
 Result: OK
 EOF
+"
 
 test_expect_success $PREREQ '--suppress-cc=cc' '
 	test_suppression cc
@@ -918,6 +947,7 @@ test_expect_success $PREREQ '--no-bcc overrides sendemail.bcc' '
 	! grep "RCPT TO:<other@ex.com>" stdout
 '
 
+test_expect_success $PREREQ 'setup expect' '
 cat >email-using-8bit <<EOF
 From fe6ecc66ece37198fe5db91fa2fc41d9f4fe5cc4 Mon Sep 17 00:00:00 2001
 Message-Id: <bogus-message-id@example.com>
@@ -927,12 +957,15 @@ Subject: subject goes here
 
 Dieser deutsche Text enthält einen Umlaut!
 EOF
+'
 
+test_expect_success $PREREQ 'setup expect' '
 cat >content-type-decl <<EOF
 MIME-Version: 1.0
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: 8bit
 EOF
+'
 
 test_expect_success $PREREQ 'asks about and fixes 8bit encodings' '
 	clean_fake_sendmail &&
@@ -970,6 +1003,7 @@ test_expect_success $PREREQ '--8bit-encoding overrides sendemail.8bitEncoding' '
 	test_cmp actual content-type-decl
 '
 
+test_expect_success $PREREQ 'setup expect' '
 cat >email-using-8bit <<EOF
 From fe6ecc66ece37198fe5db91fa2fc41d9f4fe5cc4 Mon Sep 17 00:00:00 2001
 Message-Id: <bogus-message-id@example.com>
@@ -979,10 +1013,13 @@ Subject: Dieser Betreff enthält auch einen Umlaut!
 
 Nothing to see here.
 EOF
+'
 
+test_expect_success $PREREQ 'setup expect' '
 cat >expected <<EOF
 Subject: =?UTF-8?q?Dieser=20Betreff=20enth=C3=A4lt=20auch=20einen=20Umlaut!?=
 EOF
+'
 
 test_expect_success $PREREQ '--8bit-encoding also treats subject' '
 	clean_fake_sendmail &&
-- 
1.7.2.1.338.gf2379

[PATCH 05/10] t/t9001-send-email.sh: Remove needless PROG=* assignment

From: Ævar Arnfjörð Bjarmason <hidden>
Date: 2016-06-15 22:49:18

Remove the PROG=* assignment from t9001-send-email.sh. It's been there
since v1.4.0-rc1~30 when the test was originally added, but only tests
that source annotate-tests.sh need it, it was seemingly introduced to
this test via copy/paste coding.

Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
---
 t/t9001-send-email.sh |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh
index 23597cc..6525d1d 100755
--- a/t/t9001-send-email.sh
+++ b/t/t9001-send-email.sh
@@ -8,7 +8,6 @@ if ! test_have_prereq PERL; then
 	test_done
 fi
 
-PROG='git send-email'
 test_expect_success \
     'prepare reference tree' \
     'echo "1A quick brown fox jumps over the" >file &&
-- 
1.7.2.1.338.gf2379

[PATCH 02/10] t/t3701-add-interactive.sh: change from skip_all=* to prereq skip

From: Ævar Arnfjörð Bjarmason <hidden>
Date: 2016-06-15 22:49:18

Change this test to skip test with test prerequisites, and to do setup
work in tests. This improves the skipped statistics on platforms where
the test isn't run.

Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
---
 t/t3701-add-interactive.sh |  104 +++++++++++++++++++++++++++++--------------
 1 files changed, 70 insertions(+), 34 deletions(-)
diff --git a/t/t3701-add-interactive.sh b/t/t3701-add-interactive.sh
index 75ec90b..d6327e7 100755
--- a/t/t3701-add-interactive.sh
+++ b/t/t3701-add-interactive.sh
@@ -4,21 +4,18 @@ test_description='add -i basic tests'
 . ./test-lib.sh
 . "$TEST_DIRECTORY"/lib-prereq-FILEMODE.sh
 
-if ! test_have_prereq PERL; then
-	skip_all='skipping git add -i tests, perl not available'
-	test_done
-fi
-
-test_expect_success 'setup (initial)' '
+test_expect_success PERL 'setup (initial)' '
 	echo content >file &&
 	git add file &&
 	echo more >>file &&
 	echo lines >>file
 '
-test_expect_success 'status works (initial)' '
+test_expect_success PERL 'status works (initial)' '
 	git add -i </dev/null >output &&
 	grep "+1/-0 *+2/-0 file" output
 '
+
+test_expect_success PERL 'setup expected' '
 cat >expected <<EOF
 new file mode 100644
 index 0000000..d95f3ad
@@ -27,19 +24,21 @@ index 0000000..d95f3ad
 @@ -0,0 +1 @@
 +content
 EOF
-test_expect_success 'diff works (initial)' '
+'
+
+test_expect_success PERL 'diff works (initial)' '
 	(echo d; echo 1) | git add -i >output &&
 	sed -ne "/new file/,/content/p" <output >diff &&
 	test_cmp expected diff
 '
-test_expect_success 'revert works (initial)' '
+test_expect_success PERL 'revert works (initial)' '
 	git add file &&
 	(echo r; echo 1) | git add -i &&
 	git ls-files >output &&
 	! grep . output
 '
 
-test_expect_success 'setup (commit)' '
+test_expect_success PERL 'setup (commit)' '
 	echo baseline >file &&
 	git add file &&
 	git commit -m commit &&
@@ -48,10 +47,12 @@ test_expect_success 'setup (commit)' '
 	echo more >>file &&
 	echo lines >>file
 '
-test_expect_success 'status works (commit)' '
+test_expect_success PERL 'status works (commit)' '
 	git add -i </dev/null >output &&
 	grep "+1/-0 *+2/-0 file" output
 '
+
+test_expect_success PERL 'setup expected' '
 cat >expected <<EOF
 index 180b47c..b6f2c08 100644
 --- a/file
@@ -60,60 +61,79 @@ index 180b47c..b6f2c08 100644
  baseline
 +content
 EOF
-test_expect_success 'diff works (commit)' '
+'
+
+test_expect_success PERL 'diff works (commit)' '
 	(echo d; echo 1) | git add -i >output &&
 	sed -ne "/^index/,/content/p" <output >diff &&
 	test_cmp expected diff
 '
-test_expect_success 'revert works (commit)' '
+test_expect_success PERL 'revert works (commit)' '
 	git add file &&
 	(echo r; echo 1) | git add -i &&
 	git add -i </dev/null >output &&
 	grep "unchanged *+3/-0 file" output
 '
 
+
+test_expect_success PERL 'setup expected' '
 cat >expected <<EOF
 EOF
-cat >fake_editor.sh <<EOF
-EOF
-chmod a+x fake_editor.sh
-test_set_editor "$(pwd)/fake_editor.sh"
-test_expect_success 'dummy edit works' '
+'
+
+test_expect_success PERL 'setup fake editor' '
+	cat >fake_editor.sh <<EOF
+	EOF
+	chmod a+x fake_editor.sh &&
+	test_set_editor "$(pwd)/fake_editor.sh" &&
+'
+
+test_expect_success PERL 'dummy edit works' '
 	(echo e; echo a) | git add -p &&
 	git diff > diff &&
 	test_cmp expected diff
 '
 
+test_expect_success PERL 'setup patch' '
 cat >patch <<EOF
 @@ -1,1 +1,4 @@
  this
 +patch
--doesn't
+-does not
  apply
 EOF
-echo "#!$SHELL_PATH" >fake_editor.sh
-cat >>fake_editor.sh <<\EOF
+'
+
+test_expect_success PERL 'setup fake editor' '
+	echo "#!$SHELL_PATH" >fake_editor.sh &&
+	cat >>fake_editor.sh <<\EOF &&
 mv -f "$1" oldpatch &&
 mv -f patch "$1"
 EOF
-chmod a+x fake_editor.sh
-test_set_editor "$(pwd)/fake_editor.sh"
-test_expect_success 'bad edit rejected' '
+	chmod a+x fake_editor.sh &&
+	test_set_editor "$(pwd)/fake_editor.sh"
+'
+
+test_expect_success PERL 'bad edit rejected' '
 	git reset &&
 	(echo e; echo n; echo d) | git add -p >output &&
 	grep "hunk does not apply" output
 '
 
+test_expect_success PERL 'setup patch' '
 cat >patch <<EOF
 this patch
 is garbage
 EOF
-test_expect_success 'garbage edit rejected' '
+'
+
+test_expect_success PERL 'garbage edit rejected' '
 	git reset &&
 	(echo e; echo n; echo d) | git add -p >output &&
 	grep "hunk does not apply" output
 '
 
+test_expect_success PERL 'setup patch' '
 cat >patch <<EOF
 @@ -1,0 +1,0 @@
  baseline
@@ -121,6 +141,9 @@ cat >patch <<EOF
 +newcontent
 +lines
 EOF
+'
+
+test_expect_success PERL 'setup expected' '
 cat >expected <<EOF
 diff --git a/file b/file
 index b5dd6c9..f910ae9 100644
@@ -133,13 +156,15 @@ index b5dd6c9..f910ae9 100644
 +more
  lines
 EOF
-test_expect_success 'real edit works' '
+'
+
+test_expect_success PERL 'real edit works' '
 	(echo e; echo n; echo d) | git add -p &&
 	git diff >output &&
 	test_cmp expected output
 '
 
-test_expect_success 'skip files similarly as commit -a' '
+test_expect_success PERL 'skip files similarly as commit -a' '
 	git reset &&
 	echo file >.gitignore &&
 	echo changed >file &&
@@ -153,7 +178,7 @@ test_expect_success 'skip files similarly as commit -a' '
 '
 rm -f .gitignore
 
-test_expect_success FILEMODE 'patch does not affect mode' '
+test_expect_success PERL,FILEMODE 'patch does not affect mode' '
 	git reset --hard &&
 	echo content >>file &&
 	chmod +x file &&
@@ -162,7 +187,7 @@ test_expect_success FILEMODE 'patch does not affect mode' '
 	git diff file | grep "new mode"
 '
 
-test_expect_success FILEMODE 'stage mode but not hunk' '
+test_expect_success PERL,FILEMODE 'stage mode but not hunk' '
 	git reset --hard &&
 	echo content >>file &&
 	chmod +x file &&
@@ -172,7 +197,7 @@ test_expect_success FILEMODE 'stage mode but not hunk' '
 '
 
 
-test_expect_success FILEMODE 'stage mode and hunk' '
+test_expect_success PERL,FILEMODE 'stage mode and hunk' '
 	git reset --hard &&
 	echo content >>file &&
 	chmod +x file &&
@@ -184,13 +209,14 @@ test_expect_success FILEMODE 'stage mode and hunk' '
 
 # end of tests disabled when filemode is not usable
 
-test_expect_success 'setup again' '
+test_expect_success PERL 'setup again' '
 	git reset --hard &&
 	test_chmod +x file &&
 	echo content >>file
 '
 
 # Write the patch file with a new line at the top and bottom
+test_expect_success PERL 'setup patch' '
 cat >patch <<EOF
 index 180b47c..b6f2c08 100644
 --- a/file
@@ -201,7 +227,10 @@ index 180b47c..b6f2c08 100644
  content
 +lastline
 EOF
+'
+
 # Expected output, similar to the patch but w/ diff at the top
+test_expect_success PERL 'setup expected' '
 cat >expected <<EOF
 diff --git a/file b/file
 index b6f2c08..61b9053 100755
@@ -213,8 +242,10 @@ index b6f2c08..61b9053 100755
  content
 +lastline
 EOF
+'
+
 # Test splitting the first patch, then adding both
-test_expect_success 'add first line works' '
+test_expect_success PERL 'add first line works' '
 	git commit -am "clear local changes" &&
 	git apply patch &&
 	(echo s; echo y; echo y) | git add -p file &&
@@ -222,6 +253,7 @@ test_expect_success 'add first line works' '
 	test_cmp expected diff
 '
 
+test_expect_success PERL 'setup expected' '
 cat >expected <<EOF
 diff --git a/non-empty b/non-empty
 deleted file mode 100644
@@ -231,7 +263,9 @@ index d95f3ad..0000000
 @@ -1 +0,0 @@
 -content
 EOF
-test_expect_success 'deleting a non-empty file' '
+'
+
+test_expect_success PERL 'deleting a non-empty file' '
 	git reset --hard &&
 	echo content >non-empty &&
 	git add non-empty &&
@@ -242,13 +276,15 @@ test_expect_success 'deleting a non-empty file' '
 	test_cmp expected diff
 '
 
+test_expect_success PERL 'setup expected' '
 cat >expected <<EOF
 diff --git a/empty b/empty
 deleted file mode 100644
 index e69de29..0000000
 EOF
+'
 
-test_expect_success 'deleting an empty file' '
+test_expect_success PERL 'deleting an empty file' '
 	git reset --hard &&
 	> empty &&
 	git add empty &&
-- 
1.7.2.1.338.gf2379

[PATCH 03/10] lib-patch-mode tests: change from skip_all=* to prereq skip

From: Ævar Arnfjörð Bjarmason <hidden>
Date: 2016-06-15 22:49:18

Change this test to skip test with test prerequisites, and to do setup
work in tests. This improves the skipped statistics on platforms where
the test isn't run.

Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
---
 t/lib-patch-mode.sh       |    5 -----
 t/t2016-checkout-patch.sh |   28 ++++++++++++++--------------
 t/t3904-stash-patch.sh    |   10 +++++-----
 t/t7105-reset-patch.sh    |    8 ++++----
 4 files changed, 23 insertions(+), 28 deletions(-)
diff --git a/t/lib-patch-mode.sh b/t/lib-patch-mode.sh
index 375e248..06c3c91 100644
--- a/t/lib-patch-mode.sh
+++ b/t/lib-patch-mode.sh
@@ -2,11 +2,6 @@
 
 . ./test-lib.sh
 
-if ! test_have_prereq PERL; then
-	skip_all='skipping --patch tests, perl not available'
-	test_done
-fi
-
 set_state () {
 	echo "$3" > "$1" &&
 	git add "$1" &&
diff --git a/t/t2016-checkout-patch.sh b/t/t2016-checkout-patch.sh
index 2144184..7657ec1 100755
--- a/t/t2016-checkout-patch.sh
+++ b/t/t2016-checkout-patch.sh
@@ -4,7 +4,7 @@ test_description='git checkout --patch'
 
 . ./lib-patch-mode.sh
 
-test_expect_success 'setup' '
+test_expect_success PERL 'setup' '
 	mkdir dir &&
 	echo parent > dir/foo &&
 	echo dummy > bar &&
@@ -18,40 +18,40 @@ test_expect_success 'setup' '
 
 # note: bar sorts before dir/foo, so the first 'n' is always to skip 'bar'
 
-test_expect_success 'saying "n" does nothing' '
+test_expect_success PERL 'saying "n" does nothing' '
 	set_and_save_state dir/foo work head &&
 	(echo n; echo n) | git checkout -p &&
 	verify_saved_state bar &&
 	verify_saved_state dir/foo
 '
 
-test_expect_success 'git checkout -p' '
+test_expect_success PERL 'git checkout -p' '
 	(echo n; echo y) | git checkout -p &&
 	verify_saved_state bar &&
 	verify_state dir/foo head head
 '
 
-test_expect_success 'git checkout -p with staged changes' '
+test_expect_success PERL 'git checkout -p with staged changes' '
 	set_state dir/foo work index
 	(echo n; echo y) | git checkout -p &&
 	verify_saved_state bar &&
 	verify_state dir/foo index index
 '
 
-test_expect_success 'git checkout -p HEAD with NO staged changes: abort' '
+test_expect_success PERL 'git checkout -p HEAD with NO staged changes: abort' '
 	set_and_save_state dir/foo work head &&
 	(echo n; echo y; echo n) | git checkout -p HEAD &&
 	verify_saved_state bar &&
 	verify_saved_state dir/foo
 '
 
-test_expect_success 'git checkout -p HEAD with NO staged changes: apply' '
+test_expect_success PERL 'git checkout -p HEAD with NO staged changes: apply' '
 	(echo n; echo y; echo y) | git checkout -p HEAD &&
 	verify_saved_state bar &&
 	verify_state dir/foo head head
 '
 
-test_expect_success 'git checkout -p HEAD with change already staged' '
+test_expect_success PERL 'git checkout -p HEAD with change already staged' '
 	set_state dir/foo index index
 	# the third n is to get out in case it mistakenly does not apply
 	(echo n; echo y; echo n) | git checkout -p HEAD &&
@@ -59,14 +59,14 @@ test_expect_success 'git checkout -p HEAD with change already staged' '
 	verify_state dir/foo head head
 '
 
-test_expect_success 'git checkout -p HEAD^' '
+test_expect_success PERL 'git checkout -p HEAD^' '
 	# the third n is to get out in case it mistakenly does not apply
 	(echo n; echo y; echo n) | git checkout -p HEAD^ &&
 	verify_saved_state bar &&
 	verify_state dir/foo parent parent
 '
 
-test_expect_success 'git checkout -p handles deletion' '
+test_expect_success PERL 'git checkout -p handles deletion' '
 	set_state dir/foo work index &&
 	rm dir/foo &&
 	(echo n; echo y) | git checkout -p &&
@@ -79,28 +79,28 @@ test_expect_success 'git checkout -p handles deletion' '
 # dir/foo.  There's always an extra 'n' to reject edits to dir/foo in
 # the failure case (and thus get out of the loop).
 
-test_expect_success 'path limiting works: dir' '
+test_expect_success PERL 'path limiting works: dir' '
 	set_state dir/foo work head &&
 	(echo y; echo n) | git checkout -p dir &&
 	verify_saved_state bar &&
 	verify_state dir/foo head head
 '
 
-test_expect_success 'path limiting works: -- dir' '
+test_expect_success PERL 'path limiting works: -- dir' '
 	set_state dir/foo work head &&
 	(echo y; echo n) | git checkout -p -- dir &&
 	verify_saved_state bar &&
 	verify_state dir/foo head head
 '
 
-test_expect_success 'path limiting works: HEAD^ -- dir' '
+test_expect_success PERL 'path limiting works: HEAD^ -- dir' '
 	# the third n is to get out in case it mistakenly does not apply
 	(echo y; echo n; echo n) | git checkout -p HEAD^ -- dir &&
 	verify_saved_state bar &&
 	verify_state dir/foo parent parent
 '
 
-test_expect_success 'path limiting works: foo inside dir' '
+test_expect_success PERL 'path limiting works: foo inside dir' '
 	set_state dir/foo work head &&
 	# the third n is to get out in case it mistakenly does not apply
 	(echo y; echo n; echo n) | (cd dir && git checkout -p foo) &&
@@ -108,7 +108,7 @@ test_expect_success 'path limiting works: foo inside dir' '
 	verify_state dir/foo head head
 '
 
-test_expect_success 'none of this moved HEAD' '
+test_expect_success PERL 'none of this moved HEAD' '
 	verify_saved_head
 '
 
diff --git a/t/t3904-stash-patch.sh b/t/t3904-stash-patch.sh
index f37e3bc..d1819ca 100755
--- a/t/t3904-stash-patch.sh
+++ b/t/t3904-stash-patch.sh
@@ -3,7 +3,7 @@
 test_description='git checkout --patch'
 . ./lib-patch-mode.sh
 
-test_expect_success 'setup' '
+test_expect_success PERL 'setup' '
 	mkdir dir &&
 	echo parent > dir/foo &&
 	echo dummy > bar &&
@@ -19,14 +19,14 @@ test_expect_success 'setup' '
 
 # note: bar sorts before dir, so the first 'n' is always to skip 'bar'
 
-test_expect_success 'saying "n" does nothing' '
+test_expect_success PERL 'saying "n" does nothing' '
 	set_state dir/foo work index
 	(echo n; echo n) | test_must_fail git stash save -p &&
 	verify_state dir/foo work index &&
 	verify_saved_state bar
 '
 
-test_expect_success 'git stash -p' '
+test_expect_success PERL 'git stash -p' '
 	(echo n; echo y) | git stash save -p &&
 	verify_state dir/foo head index &&
 	verify_saved_state bar &&
@@ -36,7 +36,7 @@ test_expect_success 'git stash -p' '
 	verify_state bar dummy dummy
 '
 
-test_expect_success 'git stash -p --no-keep-index' '
+test_expect_success PERL 'git stash -p --no-keep-index' '
 	set_state dir/foo work index &&
 	set_state bar bar_work bar_index &&
 	(echo n; echo y) | git stash save -p --no-keep-index &&
@@ -48,7 +48,7 @@ test_expect_success 'git stash -p --no-keep-index' '
 	verify_state bar dummy bar_index
 '
 
-test_expect_success 'none of this moved HEAD' '
+test_expect_success PERL 'none of this moved HEAD' '
 	verify_saved_head
 '
 
diff --git a/t/t7105-reset-patch.sh b/t/t7105-reset-patch.sh
index c1f4fc3..4b629f7 100755
--- a/t/t7105-reset-patch.sh
+++ b/t/t7105-reset-patch.sh
@@ -41,27 +41,27 @@ test_expect_success 'git reset -p HEAD^' '
 # dir/foo.  There's always an extra 'n' to reject edits to dir/foo in
 # the failure case (and thus get out of the loop).
 
-test_expect_success 'git reset -p dir' '
+test_expect_success PERL 'git reset -p dir' '
 	set_state dir/foo work work
 	(echo y; echo n) | git reset -p dir &&
 	verify_state dir/foo work head &&
 	verify_saved_state bar
 '
 
-test_expect_success 'git reset -p -- foo (inside dir)' '
+test_expect_success PERL 'git reset -p -- foo (inside dir)' '
 	set_state dir/foo work work
 	(echo y; echo n) | (cd dir && git reset -p -- foo) &&
 	verify_state dir/foo work head &&
 	verify_saved_state bar
 '
 
-test_expect_success 'git reset -p HEAD^ -- dir' '
+test_expect_success PERL 'git reset -p HEAD^ -- dir' '
 	(echo y; echo n) | git reset -p HEAD^ -- dir &&
 	verify_state dir/foo work parent &&
 	verify_saved_state bar
 '
 
-test_expect_success 'none of this moved HEAD' '
+test_expect_success PERL 'none of this moved HEAD' '
 	verify_saved_head
 '
 
-- 
1.7.2.1.338.gf2379

[PATCH 10/10] t/t9602-cvsimport-branches-tags.sh: Add a PERL prerequisite

From: Ævar Arnfjörð Bjarmason <hidden>
Date: 2016-06-15 22:49:18

Change this test to declare a PERL prerequisite. These tests use the
-p switch, so they implicitly depend on Perl code, but nothing was
declaring this.

Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
---
 t/t9602-cvsimport-branches-tags.sh |   28 +++++++++++++++-------------
 1 files changed, 15 insertions(+), 13 deletions(-)
diff --git a/t/t9602-cvsimport-branches-tags.sh b/t/t9602-cvsimport-branches-tags.sh
index 67878b2..89da4ae 100755
--- a/t/t9602-cvsimport-branches-tags.sh
+++ b/t/t9602-cvsimport-branches-tags.sh
@@ -6,70 +6,72 @@
 test_description='git cvsimport handling of branches and tags'
 . ./lib-cvs.sh
 
-CVSROOT="$TEST_DIRECTORY"/t9602/cvsroot
-export CVSROOT
+test_expect_success PERL 'setup CVSROOT' '
+	CVSROOT="$TEST_DIRECTORY"/t9602/cvsroot &&
+	export CVSROOT
+'
 
-test_expect_success 'import module' '
+test_expect_success PERL 'import module' '
 
 	git cvsimport -C module-git module
 
 '
 
-test_expect_success 'test branch master' '
+test_expect_success PERL 'test branch master' '
 
 	test_cmp_branch_tree master
 
 '
 
-test_expect_success 'test branch vendorbranch' '
+test_expect_success PERL 'test branch vendorbranch' '
 
 	test_cmp_branch_tree vendorbranch
 
 '
 
-test_expect_failure 'test branch B_FROM_INITIALS' '
+test_expect_failure PERL 'test branch B_FROM_INITIALS' '
 
 	test_cmp_branch_tree B_FROM_INITIALS
 
 '
 
-test_expect_failure 'test branch B_FROM_INITIALS_BUT_ONE' '
+test_expect_failure PERL 'test branch B_FROM_INITIALS_BUT_ONE' '
 
 	test_cmp_branch_tree B_FROM_INITIALS_BUT_ONE
 
 '
 
-test_expect_failure 'test branch B_MIXED' '
+test_expect_failure PERL 'test branch B_MIXED' '
 
 	test_cmp_branch_tree B_MIXED
 
 '
 
-test_expect_success 'test branch B_SPLIT' '
+test_expect_success PERL 'test branch B_SPLIT' '
 
 	test_cmp_branch_tree B_SPLIT
 
 '
 
-test_expect_failure 'test tag vendortag' '
+test_expect_failure PERL 'test tag vendortag' '
 
 	test_cmp_branch_tree vendortag
 
 '
 
-test_expect_success 'test tag T_ALL_INITIAL_FILES' '
+test_expect_success PERL 'test tag T_ALL_INITIAL_FILES' '
 
 	test_cmp_branch_tree T_ALL_INITIAL_FILES
 
 '
 
-test_expect_failure 'test tag T_ALL_INITIAL_FILES_BUT_ONE' '
+test_expect_failure PERL 'test tag T_ALL_INITIAL_FILES_BUT_ONE' '
 
 	test_cmp_branch_tree T_ALL_INITIAL_FILES_BUT_ONE
 
 '
 
-test_expect_failure 'test tag T_MIXED' '
+test_expect_failure PERL 'test tag T_MIXED' '
 
 	test_cmp_branch_tree T_MIXED
 
-- 
1.7.2.1.338.gf2379

[PATCH 01/10] tests: Move FILEMODE prerequisite to lib-prereq-FILEMODE.sh

From: Ævar Arnfjörð Bjarmason <hidden>
Date: 2016-06-15 22:49:19

Change the five tests that were all checking "git config --bool
core.filemode" to use a new FILEMODE prerequisite in
lib-prereq-FILEMODE.sh.

Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
---
 t/lib-prereq-FILEMODE.sh       |   11 +++++++++++
 t/t3701-add-interactive.sh     |    8 +-------
 t/t4102-apply-rename.sh        |    8 +-------
 t/t4129-apply-samemode.sh      |    8 +-------
 t/t6031-merge-recursive.sh     |    6 +-----
 t/t9200-git-cvsexportcommit.sh |    6 +-----
 6 files changed, 16 insertions(+), 31 deletions(-)
 create mode 100644 t/lib-prereq-FILEMODE.sh
diff --git a/t/lib-prereq-FILEMODE.sh b/t/lib-prereq-FILEMODE.sh
new file mode 100644
index 0000000..bce5a4c
--- /dev/null
+++ b/t/lib-prereq-FILEMODE.sh
@@ -0,0 +1,11 @@
+#!/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 7ad8465..75ec90b 100755
--- a/t/t3701-add-interactive.sh
+++ b/t/t3701-add-interactive.sh
@@ -2,6 +2,7 @@
 
 test_description='add -i basic tests'
 . ./test-lib.sh
+. "$TEST_DIRECTORY"/lib-prereq-FILEMODE.sh
 
 if ! test_have_prereq PERL; then
 	skip_all='skipping git add -i tests, perl not available'
@@ -152,13 +153,6 @@ test_expect_success 'skip files similarly as commit -a' '
 '
 rm -f .gitignore
 
-if test "$(git config --bool core.filemode)" = false
-then
-	say '# skipping filemode tests (filesystem does not properly support modes)'
-else
-	test_set_prereq FILEMODE
-fi
-
 test_expect_success FILEMODE 'patch does not affect mode' '
 	git reset --hard &&
 	echo content >>file &&
diff --git a/t/t4102-apply-rename.sh b/t/t4102-apply-rename.sh
index 1597965..e3ea3d5 100755
--- a/t/t4102-apply-rename.sh
+++ b/t/t4102-apply-rename.sh
@@ -7,6 +7,7 @@ test_description='git apply handling copy/rename patch.
 
 '
 . ./test-lib.sh
+. "$TEST_DIRECTORY"/lib-prereq-FILEMODE.sh
 
 # setup
 
@@ -31,13 +32,6 @@ test_expect_success setup \
 test_expect_success apply \
     'git apply --index --stat --summary --apply test-patch'
 
-if test "$(git config --bool core.filemode)" = false
-then
-	say 'filemode disabled on the filesystem'
-else
-	test_set_prereq FILEMODE
-fi
-
 test_expect_success FILEMODE validate \
 	    'test -f bar && ls -l bar | grep "^-..x......"'
 
diff --git a/t/t4129-apply-samemode.sh b/t/t4129-apply-samemode.sh
index fc7af04..0d36ebd 100755
--- a/t/t4129-apply-samemode.sh
+++ b/t/t4129-apply-samemode.sh
@@ -3,13 +3,7 @@
 test_description='applying patch with mode bits'
 
 . ./test-lib.sh
-
-if test "$(git config --bool core.filemode)" = false
-then
-	say 'filemode disabled on the filesystem'
-else
-	test_set_prereq FILEMODE
-fi
+. "$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 8a3304f..66167e3 100755
--- a/t/t6031-merge-recursive.sh
+++ b/t/t6031-merge-recursive.sh
@@ -2,11 +2,7 @@
 
 test_description='merge-recursive: handle file mode'
 . ./test-lib.sh
-
-if ! test "$(git config --bool core.filemode)" = false
-then
-	test_set_prereq FILEMODE
-fi
+. "$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 ee39b36..e5da65b 100755
--- a/t/t9200-git-cvsexportcommit.sh
+++ b/t/t9200-git-cvsexportcommit.sh
@@ -5,6 +5,7 @@
 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'
@@ -229,11 +230,6 @@ test_expect_success \
       test_must_fail git cvsexportcommit -c $id
       )'
 
-if ! test "$(git config --bool core.filemode)" = false
-then
-	test_set_prereq FILEMODE
-fi
-
 test_expect_success FILEMODE \
      'Retain execute bit' \
      'mkdir G &&
-- 
1.7.2.1.338.gf2379

[PATCH 09/10] t/t9601-cvsimport-vendor-branch.sh: Add a PERL prerequisite

From: Ævar Arnfjörð Bjarmason <hidden>
Date: 2016-06-15 22:49:19

Change this test to declare a PERL prerequisite. These tests use the
-p switch, so they implicitly depend on Perl code, but nothing was
declaring this.

Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
---
 t/t9601-cvsimport-vendor-branch.sh |   24 +++++++++++++-----------
 1 files changed, 13 insertions(+), 11 deletions(-)
diff --git a/t/t9601-cvsimport-vendor-branch.sh b/t/t9601-cvsimport-vendor-branch.sh
index 3afaf56..71178e2 100755
--- a/t/t9601-cvsimport-vendor-branch.sh
+++ b/t/t9601-cvsimport-vendor-branch.sh
@@ -34,50 +34,52 @@
 test_description='git cvsimport handling of vendor branches'
 . ./lib-cvs.sh
 
-CVSROOT="$TEST_DIRECTORY"/t9601/cvsroot
-export CVSROOT
+test_expect_success PERL 'setup CVSROOT' '
+	CVSROOT="$TEST_DIRECTORY"/t9601/cvsroot &&
+	export CVSROOT
+'
 
-test_expect_success 'import a module with a vendor branch' '
+test_expect_success PERL 'import a module with a vendor branch' '
 
 	git cvsimport -C module-git module
 
 '
 
-test_expect_success 'check HEAD out of cvs repository' 'test_cvs_co master'
+test_expect_success PERL 'check HEAD out of cvs repository' 'test_cvs_co master'
 
-test_expect_success 'check master out of git repository' 'test_git_co master'
+test_expect_success PERL 'check master out of git repository' 'test_git_co master'
 
-test_expect_success 'check a file that was imported once' '
+test_expect_success PERL 'check a file that was imported once' '
 
 	test_cmp_branch_file master imported-once.txt
 
 '
 
-test_expect_failure 'check a file that was imported twice' '
+test_expect_failure PERL 'check a file that was imported twice' '
 
 	test_cmp_branch_file master imported-twice.txt
 
 '
 
-test_expect_success 'check a file that was imported then modified on HEAD' '
+test_expect_success PERL 'check a file that was imported then modified on HEAD' '
 
 	test_cmp_branch_file master imported-modified.txt
 
 '
 
-test_expect_success 'check a file that was imported, modified, then imported again' '
+test_expect_success PERL 'check a file that was imported, modified, then imported again' '
 
 	test_cmp_branch_file master imported-modified-imported.txt
 
 '
 
-test_expect_success 'check a file that was added to HEAD then imported' '
+test_expect_success PERL 'check a file that was added to HEAD then imported' '
 
 	test_cmp_branch_file master added-imported.txt
 
 '
 
-test_expect_success 'a vendor branch whose tag has been removed' '
+test_expect_success PERL 'a vendor branch whose tag has been removed' '
 
 	test_cmp_branch_file master imported-anonymously.txt
 
-- 
1.7.2.1.338.gf2379
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help