git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ramkumar Ramachandra <artagnon@gmail.com>
To: Jonathan Nieder <jrnieder@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>,
	Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>,
	Git List <git@vger.kernel.org>
Subject: [PATCH 6/6] test: fix '&&' chaining
Date: Thu,  8 Dec 2011 18:40:17 +0530	[thread overview]
Message-ID: <1323349817-15737-9-git-send-email-artagnon@gmail.com> (raw)
In-Reply-To: <1323349817-15737-1-git-send-email-artagnon@gmail.com>

Breaks in a test assertion's && chain can potentially hide failures
from earlier commands in the chain.  Fix instances of this in the
following tests:

t3419 (rebase-patch-id)
t3310 (notes-merge-manual-resolve)
t3400 (rebase)
t3418 (rebase-continue)
t1511 (rev-parse-caret)
t1510 (repo-setup)
t1007 (hash-object)
t1412 (reflog-loop)
t1300 (repo-config)
t1013 (loose-object-format)

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
---
 t/t1007-hash-object.sh                |    2 +-
 t/t1013-loose-object-format.sh        |    2 +-
 t/t1300-repo-config.sh                |    2 +-
 t/t1412-reflog-loop.sh                |    2 +-
 t/t1510-repo-setup.sh                 |    4 ++--
 t/t1511-rev-parse-caret.sh            |    2 +-
 t/t3310-notes-merge-manual-resolve.sh |   10 +++++-----
 t/t3400-rebase.sh                     |    4 ++--
 t/t3418-rebase-continue.sh            |    4 ++--
 t/t3419-rebase-patch-id.sh            |    2 +-
 10 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/t/t1007-hash-object.sh b/t/t1007-hash-object.sh
index 6d52b82..f83df8e 100755
--- a/t/t1007-hash-object.sh
+++ b/t/t1007-hash-object.sh
@@ -189,7 +189,7 @@ for args in "-w --stdin-paths" "--stdin-paths -w"; do
 done
 
 test_expect_success 'corrupt tree' '
-	echo abc >malformed-tree
+	echo abc >malformed-tree &&
 	test_must_fail git hash-object -t tree malformed-tree
 '
 
diff --git a/t/t1013-loose-object-format.sh b/t/t1013-loose-object-format.sh
index 0a9cedd..fbf5f2f 100755
--- a/t/t1013-loose-object-format.sh
+++ b/t/t1013-loose-object-format.sh
@@ -34,7 +34,7 @@ assert_blob_equals() {
 }
 
 test_expect_success setup '
-	cp -R "$TEST_DIRECTORY/t1013/objects" .git/
+	cp -R "$TEST_DIRECTORY/t1013/objects" .git/ &&
 	git --version
 '
 
diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh
index 51caff0..0690e0e 100755
--- a/t/t1300-repo-config.sh
+++ b/t/t1300-repo-config.sh
@@ -38,7 +38,7 @@ cat > expect << EOF
 	WhatEver = Second
 EOF
 test_expect_success 'similar section' '
-	git config Cores.WhatEver Second
+	git config Cores.WhatEver Second &&
 	test_cmp expect .git/config
 '
 
diff --git a/t/t1412-reflog-loop.sh b/t/t1412-reflog-loop.sh
index 647d888..3acd895 100755
--- a/t/t1412-reflog-loop.sh
+++ b/t/t1412-reflog-loop.sh
@@ -20,7 +20,7 @@ test_expect_success 'setup reflog with alternating commits' '
 '
 
 test_expect_success 'reflog shows all entries' '
-	cat >expect <<-\EOF
+	cat >expect <<-\EOF &&
 		topic@{0} reset: moving to two
 		topic@{1} reset: moving to one
 		topic@{2} reset: moving to two
diff --git a/t/t1510-repo-setup.sh b/t/t1510-repo-setup.sh
index ec50a9a..80aedfc 100755
--- a/t/t1510-repo-setup.sh
+++ b/t/t1510-repo-setup.sh
@@ -603,7 +603,7 @@ test_expect_success '#22a: core.worktree = GIT_DIR = .git dir' '
 	# like case #6.
 
 	setup_repo 22a "$here/22a/.git" "" unset &&
-	setup_repo 22ab . "" unset
+	setup_repo 22ab . "" unset &&
 	mkdir -p 22a/.git/sub 22a/sub &&
 	mkdir -p 22ab/.git/sub 22ab/sub &&
 	try_case 22a/.git unset . \
@@ -742,7 +742,7 @@ test_expect_success '#28: core.worktree and core.bare conflict (gitfile case)' '
 # Case #29: GIT_WORK_TREE(+core.worktree) overrides core.bare (gitfile case).
 test_expect_success '#29: setup' '
 	setup_repo 29 non-existent gitfile true &&
-	mkdir -p 29/sub/sub 29/wt/sub
+	mkdir -p 29/sub/sub 29/wt/sub &&
 	(
 		cd 29 &&
 		GIT_WORK_TREE="$here/29" &&
diff --git a/t/t1511-rev-parse-caret.sh b/t/t1511-rev-parse-caret.sh
index e043cb7..eaefc77 100755
--- a/t/t1511-rev-parse-caret.sh
+++ b/t/t1511-rev-parse-caret.sh
@@ -6,7 +6,7 @@ test_description='tests for ref^{stuff}'
 
 test_expect_success 'setup' '
 	echo blob >a-blob &&
-	git tag -a -m blob blob-tag `git hash-object -w a-blob`
+	git tag -a -m blob blob-tag `git hash-object -w a-blob` &&
 	mkdir a-tree &&
 	echo moreblobs >a-tree/another-blob &&
 	git add . &&
diff --git a/t/t3310-notes-merge-manual-resolve.sh b/t/t3310-notes-merge-manual-resolve.sh
index 4ec4d11..4367197 100755
--- a/t/t3310-notes-merge-manual-resolve.sh
+++ b/t/t3310-notes-merge-manual-resolve.sh
@@ -389,7 +389,7 @@ test_expect_success 'abort notes merge' '
 	test_must_fail ls .git/NOTES_MERGE_* >output 2>/dev/null &&
 	test_cmp /dev/null output &&
 	# m has not moved (still == y)
-	test "$(git rev-parse refs/notes/m)" = "$(cat pre_merge_y)"
+	test "$(git rev-parse refs/notes/m)" = "$(cat pre_merge_y)" &&
 	# Verify that other notes refs has not changed (w, x, y and z)
 	verify_notes w &&
 	verify_notes x &&
@@ -525,9 +525,9 @@ EOF
 	test -f .git/NOTES_MERGE_WORKTREE/$commit_sha3 &&
 	test -f .git/NOTES_MERGE_WORKTREE/$commit_sha4 &&
 	# Refs are unchanged
-	test "$(git rev-parse refs/notes/m)" = "$(git rev-parse refs/notes/w)"
-	test "$(git rev-parse refs/notes/y)" = "$(git rev-parse NOTES_MERGE_PARTIAL^1)"
-	test "$(git rev-parse refs/notes/m)" != "$(git rev-parse NOTES_MERGE_PARTIAL^1)"
+	test "$(git rev-parse refs/notes/m)" = "$(git rev-parse refs/notes/w)" &&
+	test "$(git rev-parse refs/notes/y)" = "$(git rev-parse NOTES_MERGE_PARTIAL^1)" &&
+	test "$(git rev-parse refs/notes/m)" != "$(git rev-parse NOTES_MERGE_PARTIAL^1)" &&
 	# Mention refs/notes/m, and its current and expected value in output
 	grep -q "refs/notes/m" output &&
 	grep -q "$(git rev-parse refs/notes/m)" output &&
@@ -545,7 +545,7 @@ test_expect_success 'resolve situation by aborting the notes merge' '
 	test_must_fail ls .git/NOTES_MERGE_* >output 2>/dev/null &&
 	test_cmp /dev/null output &&
 	# m has not moved (still == w)
-	test "$(git rev-parse refs/notes/m)" = "$(git rev-parse refs/notes/w)"
+	test "$(git rev-parse refs/notes/m)" = "$(git rev-parse refs/notes/w)" &&
 	# Verify that other notes refs has not changed (w, x, y and z)
 	verify_notes w &&
 	verify_notes x &&
diff --git a/t/t3400-rebase.sh b/t/t3400-rebase.sh
index 6eaecec..c355533 100755
--- a/t/t3400-rebase.sh
+++ b/t/t3400-rebase.sh
@@ -172,8 +172,8 @@ test_expect_success 'fail when upstream arg is missing and not configured' '
 
 test_expect_success 'default to @{upstream} when upstream arg is missing' '
 	git checkout -b default topic &&
-	git config branch.default.remote .
-	git config branch.default.merge refs/heads/master
+	git config branch.default.remote . &&
+	git config branch.default.merge refs/heads/master &&
 	git rebase &&
 	test "$(git rev-parse default~1)" = "$(git rev-parse master)"
 '
diff --git a/t/t3418-rebase-continue.sh b/t/t3418-rebase-continue.sh
index 1e855cd..2680375 100755
--- a/t/t3418-rebase-continue.sh
+++ b/t/t3418-rebase-continue.sh
@@ -51,7 +51,7 @@ test_expect_success 'rebase --continue remembers merge strategy and options' '
 	test_commit "commit-new-file-F3-on-topic-branch" F3 32 &&
 	test_when_finished "rm -fr test-bin funny.was.run" &&
 	mkdir test-bin &&
-	cat >test-bin/git-merge-funny <<-EOF
+	cat >test-bin/git-merge-funny <<-EOF &&
 	#!$SHELL_PATH
 	case "\$1" in --opt) ;; *) exit 2 ;; esac
 	shift &&
@@ -77,7 +77,7 @@ test_expect_success 'rebase --continue remembers merge strategy and options' '
 test_expect_success 'rebase --continue remembers --rerere-autoupdate' '
 	rm -fr .git/rebase-* &&
 	git reset --hard commit-new-file-F3-on-topic-branch &&
-	git checkout master
+	git checkout master &&
 	test_commit "commit-new-file-F3" F3 3 &&
 	git config rerere.enabled true &&
 	test_must_fail git rebase -m master topic &&
diff --git a/t/t3419-rebase-patch-id.sh b/t/t3419-rebase-patch-id.sh
index bd8efaf..e70ac10 100755
--- a/t/t3419-rebase-patch-id.sh
+++ b/t/t3419-rebase-patch-id.sh
@@ -39,7 +39,7 @@ run()
 }
 
 test_expect_success 'setup' '
-	git commit --allow-empty -m initial
+	git commit --allow-empty -m initial &&
 	git tag root
 '
 
-- 
1.7.7.3

  parent reply	other threads:[~2011-12-08 13:11 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-08 13:10 [PATCH v2 0/6] Fix '&&' chaining in tests Ramkumar Ramachandra
2011-12-08 13:10 ` [PATCH 1/2] parse-options: introduce OPT_SUBCOMMAND Ramkumar Ramachandra
2011-12-08 16:30   ` Jonathan Nieder
2011-12-08 16:43     ` Ramkumar Ramachandra
2011-12-08 13:10 ` [PATCH 1/6] t3040 (subprojects-basic): modernize style Ramkumar Ramachandra
2011-12-08 16:34   ` Jonathan Nieder
2011-12-09  7:56     ` Ramkumar Ramachandra
2011-12-09 18:26       ` Junio C Hamano
2011-12-09 18:32         ` Ramkumar Ramachandra
2011-12-08 13:10 ` [PATCH 2/2] bundle: rewrite builtin to use parse-options Ramkumar Ramachandra
2011-12-08 16:39   ` Jonathan Nieder
2011-12-08 16:47     ` Ramkumar Ramachandra
2011-12-08 17:03       ` Jonathan Nieder
2011-12-08 17:38         ` Ramkumar Ramachandra
2011-12-08 17:59           ` Jonathan Nieder
2011-12-08 19:39             ` Ramkumar Ramachandra
2011-12-08 23:48               ` Junio C Hamano
2011-12-09 13:33                 ` Jakub Narebski
2011-12-09 18:24                   ` Junio C Hamano
2011-12-15 16:45             ` [PATCH 0/2] Improve git-bundle builtin Ramkumar Ramachandra
2011-12-15 16:45               ` [PATCH 1/2] t5704 (bundle): rewrite for larger coverage Ramkumar Ramachandra
2011-12-15 21:16                 ` Jonathan Nieder
2011-12-15 16:45               ` [PATCH 2/2] bundle: rewrite builtin to use parse-options Ramkumar Ramachandra
2011-12-15 21:29                 ` Jonathan Nieder
2011-12-15 20:54               ` [PATCH 0/2] Improve git-bundle builtin Jonathan Nieder
2011-12-15 21:30               ` Junio C Hamano
2011-12-08 13:10 ` [PATCH 2/6] t3030 (merge-recursive): use test_expect_code Ramkumar Ramachandra
2011-12-08 13:10 ` [PATCH 3/6] t1006 (cat-file): use test_cmp Ramkumar Ramachandra
2011-12-08 13:28   ` Matthieu Moy
2011-12-08 13:33     ` Ramkumar Ramachandra
2011-12-08 13:41       ` Matthieu Moy
2011-12-08 16:55   ` Jonathan Nieder
2011-12-08 13:10 ` [PATCH 4/6] t3200 (branch): fix '&&' chaining Ramkumar Ramachandra
2011-12-08 17:07   ` Jonathan Nieder
2011-12-08 13:10 ` [PATCH 5/6] t1510 (worktree): " Ramkumar Ramachandra
2011-12-08 17:12   ` Jonathan Nieder
2011-12-09  0:00     ` Junio C Hamano
2011-12-08 13:10 ` Ramkumar Ramachandra [this message]
2011-12-08 17:18   ` [PATCH 6/6] test: " Jonathan Nieder
2011-12-08 19:55 ` [PATCH v2 0/6] Fix '&&' chaining in tests Junio C Hamano
2011-12-09  5:23   ` Ramkumar Ramachandra
2011-12-09 11:29 ` [PATCH v3 " Ramkumar Ramachandra
2011-12-09 11:29   ` [PATCH 1/6] t3040 (subprojects-basic): fix '&&' chaining, modernize style Ramkumar Ramachandra
2011-12-09 11:29   ` [PATCH 2/6] t3030 (merge-recursive): use test_expect_code Ramkumar Ramachandra
2011-12-09 11:29   ` [PATCH 3/6] t1006 (cat-file): use test_cmp Ramkumar Ramachandra
2011-12-09 18:43     ` Junio C Hamano
2011-12-09 18:47       ` Ramkumar Ramachandra
2011-12-09 11:29   ` [PATCH 4/6] t3200 (branch): fix '&&' chaining Ramkumar Ramachandra
2011-12-09 11:29   ` [PATCH 5/6] t1510 (worktree): " Ramkumar Ramachandra
2011-12-09 11:29   ` [PATCH 6/6] tests: " Ramkumar Ramachandra

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=1323349817-15737-9-git-send-email-artagnon@gmail.com \
    --to=artagnon@gmail.com \
    --cc=Matthieu.Moy@grenoble-inp.fr \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jrnieder@gmail.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).