git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: git@vger.kernel.org
Subject: [PATCH 02/25] t: fix severe &&-chain breakage
Date: Fri, 20 Mar 2015 06:06:15 -0400	[thread overview]
Message-ID: <20150320100614.GB12543@peff.net> (raw)
In-Reply-To: <20150320100429.GA17354@peff.net>

These are tests which are missing a link in their &&-chain,
in a location which causes a significant portion of the test
to be missed (e.g., the test effectively does nothing, or
consists of a long string of actions and output comparisons,
and we throw away the exit code of at least one part of the
string).

Signed-off-by: Jeff King <peff@peff.net>
---
 t/t1300-repo-config.sh            |  2 +-
 t/t1403-show-ref.sh               | 10 +++++-----
 t/t1700-split-index.sh            |  2 +-
 t/t3600-rm.sh                     |  2 +-
 t/t4047-diff-dirstat.sh           |  2 +-
 t/t4104-apply-boundary.sh         |  4 ++--
 t/t4202-log.sh                    |  2 +-
 t/t5100-mailinfo.sh               |  2 +-
 t/t5510-fetch.sh                  |  2 +-
 t/t5540-http-push-webdav.sh       |  2 +-
 t/t5551-http-fetch-smart.sh       |  2 +-
 t/t6036-recursive-corner-cases.sh |  2 +-
 t/t9300-fast-import.sh            |  2 +-
 t/t9902-completion.sh             |  2 +-
 14 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh
index 938fc8b..bc0b392 100755
--- a/t/t1300-repo-config.sh
+++ b/t/t1300-repo-config.sh
@@ -677,7 +677,7 @@ test_expect_success 'invalid unit' '
 	echo 1auto >expect &&
 	git config aninvalid.unit >actual &&
 	test_cmp expect actual &&
-	cat >expect <<-\EOF
+	cat >expect <<-\EOF &&
 	fatal: bad numeric config value '\''1auto'\'' for '\''aninvalid.unit'\'' in .git/config: invalid unit
 	EOF
 	test_must_fail git config --int --get aninvalid.unit 2>actual &&
diff --git a/t/t1403-show-ref.sh b/t/t1403-show-ref.sh
index 3e500ed..7e10bcf 100755
--- a/t/t1403-show-ref.sh
+++ b/t/t1403-show-ref.sh
@@ -28,7 +28,7 @@ test_expect_success 'show-ref' '
 
 	>expect &&
 
-	test_must_fail git show-ref D >actual
+	test_must_fail git show-ref D >actual &&
 	test_cmp expect actual
 '
 
@@ -62,7 +62,7 @@ test_expect_success 'show-ref --verify' '
 	test_must_fail git show-ref --verify tags/A >actual &&
 	test_cmp expect actual &&
 
-	test_must_fail git show-ref --verify D >actual
+	test_must_fail git show-ref --verify D >actual &&
 	test_cmp expect actual
 '
 
@@ -78,7 +78,7 @@ test_expect_success 'show-ref --verify -q' '
 	test_must_fail git show-ref --verify -q tags/A >actual &&
 	test_cmp expect actual &&
 
-	test_must_fail git show-ref --verify -q D >actual
+	test_must_fail git show-ref --verify -q D >actual &&
 	test_cmp expect actual
 '
 
@@ -105,10 +105,10 @@ test_expect_success 'show-ref -d' '
 	test_cmp expect actual &&
 
 	git show-ref -d refs/heads/master >actual &&
-	test_cmp expect actual
+	test_cmp expect actual &&
 
 	git show-ref -d --verify refs/heads/master >actual &&
-	test_cmp expect actual
+	test_cmp expect actual &&
 
 	>expect &&
 
diff --git a/t/t1700-split-index.sh b/t/t1700-split-index.sh
index 94fb473..a55f5bc 100755
--- a/t/t1700-split-index.sh
+++ b/t/t1700-split-index.sh
@@ -182,7 +182,7 @@ test_expect_success 'unify index, two files remain' '
 100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0	one
 100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0	two
 EOF
-	test_cmp ls-files.expect ls-files.actual
+	test_cmp ls-files.expect ls-files.actual &&
 
 	test-dump-split-index .git/index | sed "/^own/d" >actual &&
 	cat >expect <<EOF &&
diff --git a/t/t3600-rm.sh b/t/t3600-rm.sh
index e00d7d2..b0db89b 100755
--- a/t/t3600-rm.sh
+++ b/t/t3600-rm.sh
@@ -170,7 +170,7 @@ test_expect_success 'but with -f it should work.' '
 	git rm -f foo baz &&
 	test ! -f foo &&
 	test ! -f baz &&
-	test_must_fail git ls-files --error-unmatch foo
+	test_must_fail git ls-files --error-unmatch foo &&
 	test_must_fail git ls-files --error-unmatch baz
 '
 
diff --git a/t/t4047-diff-dirstat.sh b/t/t4047-diff-dirstat.sh
index 0d50dce..3b8b792 100755
--- a/t/t4047-diff-dirstat.sh
+++ b/t/t4047-diff-dirstat.sh
@@ -374,7 +374,7 @@ test_expect_success 'later options override earlier options:' '
 	git diff --dirstat=files,10,cumulative,changes,noncumulative,3 -M HEAD^..HEAD >actual_diff_dirstat_M &&
 	test_cmp expect_diff_dirstat_M actual_diff_dirstat_M &&
 	git diff --dirstat=files,10,cumulative,changes,noncumulative,3 -C -C HEAD^..HEAD >actual_diff_dirstat_CC &&
-	test_cmp expect_diff_dirstat_CC actual_diff_dirstat_CC
+	test_cmp expect_diff_dirstat_CC actual_diff_dirstat_CC &&
 	git diff --dirstat=files --dirstat=10 --dirstat=cumulative --dirstat=changes --dirstat=noncumulative -X3 HEAD^..HEAD >actual_diff_dirstat &&
 	test_cmp expect_diff_dirstat actual_diff_dirstat &&
 	git diff --dirstat=files --dirstat=10 --dirstat=cumulative --dirstat=changes --dirstat=noncumulative -X3 -M HEAD^..HEAD >actual_diff_dirstat_M &&
diff --git a/t/t4104-apply-boundary.sh b/t/t4104-apply-boundary.sh
index c617c2a..c97aad1 100755
--- a/t/t4104-apply-boundary.sh
+++ b/t/t4104-apply-boundary.sh
@@ -78,8 +78,8 @@ test_expect_success setup '
 		echo $i
 	done >victim &&
 	cat victim >del-z-expect &&
-	git diff victim >del-z-patch.with
-	git diff --unified=0 >del-z-patch.without &&
+	git diff victim >del-z-patch.with &&
+	git diff --unified=0 >del-z-patch.without
 
 	: done
 '
diff --git a/t/t4202-log.sh b/t/t4202-log.sh
index 5f2b290..a22ac7c 100755
--- a/t/t4202-log.sh
+++ b/t/t4202-log.sh
@@ -481,7 +481,7 @@ test_expect_success 'log.decorate configuration' '
 	git log --oneline --no-decorate >actual &&
 	test_cmp expect.none actual &&
 	git log --oneline --decorate >actual &&
-	test_cmp expect.short actual
+	test_cmp expect.short actual &&
 
 	test_unconfig log.decorate &&
 	git log --pretty=raw >expect.raw &&
diff --git a/t/t5100-mailinfo.sh b/t/t5100-mailinfo.sh
index 60df10f..e97cfb2 100755
--- a/t/t5100-mailinfo.sh
+++ b/t/t5100-mailinfo.sh
@@ -34,7 +34,7 @@ do
 		if test -f "$TEST_DIRECTORY"/t5100/msg$mail--no-inbody-headers
 		then
 			check_mailinfo $mail --no-inbody-headers
-		fi
+		fi &&
 		if test -f "$TEST_DIRECTORY"/t5100/msg$mail--message-id
 		then
 			check_mailinfo $mail --message-id
diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh
index d78f320..d3fa2c9 100755
--- a/t/t5510-fetch.sh
+++ b/t/t5510-fetch.sh
@@ -124,7 +124,7 @@ test_expect_success 'fetch --prune handles overlapping refspecs' '
 	git rev-parse origin/master &&
 	git rev-parse origin/pr/42 &&
 
-	git config --unset-all remote.origin.fetch
+	git config --unset-all remote.origin.fetch &&
 	git config remote.origin.fetch refs/pull/*/head:refs/remotes/origin/pr/* &&
 	git config --add remote.origin.fetch refs/heads/*:refs/remotes/origin/* &&
 
diff --git a/t/t5540-http-push-webdav.sh b/t/t5540-http-push-webdav.sh
index 8d7b3c5..88ff5a4 100755
--- a/t/t5540-http-push-webdav.sh
+++ b/t/t5540-http-push-webdav.sh
@@ -169,7 +169,7 @@ test_expect_failure 'push to password-protected repository (no user in URL)' '
 	test_commit pw-nouser &&
 	set_askpass user@host pass@host &&
 	git push "$HTTPD_URL/auth/dumb/test_repo.git" HEAD &&
-	expect_askpass both user@host
+	expect_askpass both user@host &&
 	git rev-parse --verify HEAD >expect &&
 	git --git-dir="$HTTPD_DOCUMENT_ROOT_PATH/auth/dumb/test_repo.git" \
 		rev-parse --verify HEAD >actual &&
diff --git a/t/t5551-http-fetch-smart.sh b/t/t5551-http-fetch-smart.sh
index 6cbc12d..eae20d9 100755
--- a/t/t5551-http-fetch-smart.sh
+++ b/t/t5551-http-fetch-smart.sh
@@ -169,7 +169,7 @@ test_expect_success 'GIT_SMART_HTTP can disable smart http' '
 '
 
 test_expect_success 'invalid Content-Type rejected' '
-	test_must_fail git clone $HTTPD_URL/broken_smart/repo.git 2>actual
+	test_must_fail git clone $HTTPD_URL/broken_smart/repo.git 2>actual &&
 	grep "not valid:" actual
 '
 
diff --git a/t/t6036-recursive-corner-cases.sh b/t/t6036-recursive-corner-cases.sh
index a86087b..b43d031 100755
--- a/t/t6036-recursive-corner-cases.sh
+++ b/t/t6036-recursive-corner-cases.sh
@@ -533,7 +533,7 @@ test_expect_success 'merge of E2 & D fails but has appropriate contents' '
 
 	test $(git rev-parse :3:a) = $(git rev-parse B:a) &&
 	test $(git rev-parse :2:a/file) = $(git rev-parse E2:a/file) &&
-	test $(git rev-parse :1:a/file) = $(git rev-parse C:a/file)
+	test $(git rev-parse :1:a/file) = $(git rev-parse C:a/file) &&
 	test $(git rev-parse :0:ignore-me) = $(git rev-parse A:ignore-me) &&
 
 	test -f a~D^0
diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh
index c538e0a..6bd5a00 100755
--- a/t/t9300-fast-import.sh
+++ b/t/t9300-fast-import.sh
@@ -2228,7 +2228,7 @@ test_expect_success 'R: feature import-marks-if-exists' '
 	>expect &&
 
 	git fast-import --import-marks-if-exists=not_io.marks \
-			--export-marks=io.marks <<-\EOF
+			--export-marks=io.marks <<-\EOF &&
 	feature import-marks-if-exists=io.marks
 	EOF
 	test_cmp expect io.marks
diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh
index 7a883d1..4a14a58 100755
--- a/t/t9902-completion.sh
+++ b/t/t9902-completion.sh
@@ -568,7 +568,7 @@ test_expect_success 'complete files' '
 	test_completion "git commit " "modified" &&
 
 	: TODO .gitignore should not be here &&
-	test_completion "git ls-files " <<-\EOF
+	test_completion "git ls-files " <<-\EOF &&
 	.gitignore
 	dir
 	modified
-- 
2.3.3.520.g3cfbb5d

  parent reply	other threads:[~2015-03-20 10:06 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-20 10:04 [PATCH 0/25] detecting &&-chain breakage Jeff King
2015-03-20 10:05 ` [PATCH 01/25] t/test-lib: introduce --chain-lint option Jeff King
2015-03-25  2:53   ` SZEDER Gábor
2015-03-25  3:05     ` Jeff King
2015-03-20 10:06 ` Jeff King [this message]
2015-03-20 10:06 ` [PATCH 03/25] t: fix moderate &&-chain breakage Jeff King
2015-03-20 10:07 ` [PATCH 04/25] t: fix trivial " Jeff King
2015-03-20 10:07 ` [PATCH 05/25] t: assume test_cmp produces verbose output Jeff King
2015-03-20 10:09 ` [PATCH 06/25] t: use verbose instead of hand-rolled errors Jeff King
2015-03-20 10:09 ` [PATCH 07/25] t: use test_must_fail instead of hand-rolled blocks Jeff King
2015-03-20 10:10 ` [PATCH 08/25] t: fix &&-chaining issues around setup which might fail Jeff King
2015-03-20 10:11 ` [PATCH 09/25] t: use test_might_fail for diff and grep Jeff King
2015-03-20 10:11 ` [PATCH 10/25] t: use test_expect_code instead of hand-rolled comparison Jeff King
2015-03-20 10:12 ` [PATCH 11/25] t: wrap complicated expect_code users in a block Jeff King
2015-03-20 10:12 ` [PATCH 12/25] t: avoid using ":" for comments Jeff King
2015-03-20 10:12 ` [PATCH 13/25] t3600: fix &&-chain breakage for setup commands Jeff King
2015-03-20 10:12 ` [PATCH 14/25] t7201: fix &&-chain breakage Jeff King
2015-03-20 10:13 ` [PATCH 15/25] t9502: " Jeff King
2015-03-20 17:48   ` Johannes Sixt
2015-03-20 18:03     ` Jeff King
2015-03-20 10:13 ` [PATCH 16/25] t6030: use modern test_* helpers Jeff King
2015-03-20 10:13 ` [PATCH 17/25] t0020: " Jeff King
2015-03-25  0:23   ` SZEDER Gábor
2015-03-25  2:56     ` Jeff King
2015-03-25  5:24       ` [PATCH 0/8] more &&-chaining test fixups Jeff King
2015-03-25  5:25         ` [PATCH 1/8] perf-lib: fix ignored exit code inside loop Jeff King
2015-03-25  5:28         ` [PATCH 2/8] t0020: fix ignored exit code inside loops Jeff King
2015-03-25  5:28         ` [PATCH 3/8] t3305: fix ignored exit code inside loop Jeff King
2015-03-25  8:40           ` Johan Herland
2015-03-25  5:29         ` [PATCH 4/8] t7701: " Jeff King
2015-03-25  5:29         ` [PATCH 5/8] t: fix some trivial cases of ignored exit codes in loops Jeff King
2015-03-25  5:30         ` [PATCH 6/8] t: simplify loop exit-code status variables Jeff King
2015-03-25 17:27           ` Junio C Hamano
2015-03-25 17:43             ` Jeff King
2015-03-25  5:31         ` [PATCH 7/8] t0020: use test_* helpers instead of hand-rolled messages Jeff King
2015-03-25  5:32         ` [PATCH 8/8] t9001: drop save_confirm helper Jeff King
2015-03-25 17:29         ` [PATCH 0/8] more &&-chaining test fixups Junio C Hamano
2015-03-20 10:13 ` [PATCH 18/25] t1301: use modern test_* helpers Jeff King
2015-03-24 23:51   ` SZEDER Gábor
2015-03-25  2:45     ` Jeff King
2015-03-20 10:13 ` [PATCH 19/25] t6034: " Jeff King
2015-03-24 23:43   ` SZEDER Gábor
2015-03-20 10:13 ` [PATCH 20/25] t4117: " Jeff King
2015-03-20 10:13 ` [PATCH 21/25] t9001: use test_when_finished Jeff King
2015-03-25  2:00   ` SZEDER Gábor
2015-03-25  2:47     ` Jeff King
2015-03-20 10:13 ` [PATCH 22/25] t0050: appease --chain-lint Jeff King
2015-03-20 10:13 ` [PATCH 23/25] t7004: fix embedded single-quotes Jeff King
2015-03-20 10:13 ` [PATCH 24/25] t0005: fix broken &&-chains Jeff King
2015-03-20 10:13 ` [PATCH 25/25] t4104: drop hand-rolled error reporting Jeff King
2015-03-20 10:23 ` [PATCH 0/25] detecting &&-chain breakage Jeff King
2015-03-20 14:28 ` Michael J Gruber
2015-03-20 14:32   ` [PATCH 26/27] t/*svn*: fix moderate " Michael J Gruber
2015-03-20 14:32     ` [PATCH 27/27] t9104: fix test for following larger parents Michael J Gruber
2015-03-20 18:04     ` [PATCH 26/27] t/*svn*: fix moderate &&-chain breakage Junio C Hamano
2015-03-20 19:35       ` Junio C Hamano
2015-03-20 20:02         ` Jeff King
2015-03-20 20:13           ` Jeff King
2015-03-23  9:36             ` Michael J Gruber
2015-03-20 17:57   ` [PATCH 0/25] detecting " Jeff King
2015-03-20 17:44 ` Junio C Hamano
2015-03-20 18:00   ` Junio C Hamano
2015-03-20 18:04     ` Jeff King
2015-03-20 18:33       ` Junio C Hamano
2015-03-20 23:18 ` Eric Sunshine
2015-03-21  8:19   ` Jeff King
2015-03-21 18:01     ` Junio C Hamano
2015-03-21 22:23       ` Jeff King

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=20150320100614.GB12543@peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    /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).