git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: git@vger.kernel.org
Cc: "Junio C Hamano" <gitster@pobox.com>,
	"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Subject: [PATCH 03/10] lib-patch-mode tests: change from skip_all=* to prereq skip
Date: Fri, 13 Aug 2010 20:40:06 +0000	[thread overview]
Message-ID: <1281732013-18284-4-git-send-email-avarab@gmail.com> (raw)
In-Reply-To: <1281732013-18284-1-git-send-email-avarab@gmail.com>

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 <avarab@gmail.com>
---
 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

  parent reply	other threads:[~2010-08-13 20:41 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-13 20:40 [PATCH 00/10] More test suite prerequisite cleanup Ævar Arnfjörð Bjarmason
2010-08-13 20:40 ` [PATCH 01/10] tests: Move FILEMODE prerequisite to lib-prereq-FILEMODE.sh Ævar Arnfjörð Bjarmason
2010-08-13 20:40 ` [PATCH 02/10] t/t3701-add-interactive.sh: change from skip_all=* to prereq skip Ævar Arnfjörð Bjarmason
2010-08-13 20:40 ` Ævar Arnfjörð Bjarmason [this message]
2010-08-13 20:40 ` [PATCH 04/10] t/t9600-cvsimport.sh: " Ævar Arnfjörð Bjarmason
2010-08-13 20:40 ` [PATCH 05/10] t/t9001-send-email.sh: Remove needless PROG=* assignment Ævar Arnfjörð Bjarmason
2010-08-13 20:40 ` [PATCH 06/10] t/t9001-send-email.sh: change from skip_all=* to prereq skip Ævar Arnfjörð Bjarmason
2010-08-13 20:40 ` [PATCH 07/10] t/t9001-send-email.sh: convert setup code to tests Ævar Arnfjörð Bjarmason
2010-08-13 20:40 ` [PATCH 08/10] t/t7105-reset-patch.sh: Add a PERL prerequisite Ævar Arnfjörð Bjarmason
2010-08-13 20:40 ` [PATCH 09/10] t/t9601-cvsimport-vendor-branch.sh: " Ævar Arnfjörð Bjarmason
2010-08-13 20:40 ` [PATCH 10/10] t/t9602-cvsimport-branches-tags.sh: " Ævar Arnfjörð Bjarmason

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1281732013-18284-4-git-send-email-avarab@gmail.com \
    --to=avarab@gmail.com \
    --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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).