git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Olivier Marin <dkr+ml.git@free.fr>
Cc: "René Scharfe" <rene.scharfe@lsrfire.ath.cx>,
	"Johannes Schindelin" <Johannes.Schindelin@gmx.de>,
	git@vger.kernel.org
Subject: Re: [PATCH] tests: use $TEST_DIRECTORY to refer to the t/ directory
Date: Sun, 10 Aug 2008 00:33:18 -0700	[thread overview]
Message-ID: <7vvdy92ukh.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <489E1FDB.5070700@free.fr> (Olivier Marin's message of "Sun, 10 Aug 2008 00:53:15 +0200")

> OK, I read the diff and found some trivial quoting issues that will break the
> following tests if $TEST_DIRECTORY contain a space:

Thanks.  I think this should catch all of them.  I've run the tests in a
clone that has SP in it.

 t/t4101-apply-nonl.sh |    7 ++++---
 t/t5100-mailinfo.sh   |   17 +++++++++--------
 t/t7500-commit.sh     |   39 +++++++++++++++++++++++++++++----------
 3 files changed, 42 insertions(+), 21 deletions(-)

diff --git a/t/t4101-apply-nonl.sh b/t/t4101-apply-nonl.sh
index 1391d20..e3443d0 100755
--- a/t/t4101-apply-nonl.sh
+++ b/t/t4101-apply-nonl.sh
@@ -21,9 +21,10 @@ do
   do
     test $i -eq $j && continue
     cat frotz.$i >frotz
-    test_expect_success \
-        "apply diff between $i and $j" \
-	"git apply <"$TEST_DIRECTORY"/t4101/diff.$i-$j && diff frotz.$j frotz"
+    test_expect_success "apply diff between $i and $j" '
+	git apply <"$TEST_DIRECTORY"/t4101/diff.$i-$j &&
+	test_cmp frotz.$j frotz
+    '
   done
 done
 
diff --git a/t/t5100-mailinfo.sh b/t/t5100-mailinfo.sh
index a40d48b..c3ab881 100755
--- a/t/t5100-mailinfo.sh
+++ b/t/t5100-mailinfo.sh
@@ -15,20 +15,21 @@ test_expect_success 'split sample box' \
 
 for mail in `echo 00*`
 do
-	test_expect_success "mailinfo $mail" \
-		"git mailinfo -u msg$mail patch$mail <$mail >info$mail &&
+	test_expect_success "mailinfo $mail" '
+		git mailinfo -u msg$mail patch$mail <$mail >info$mail &&
 		echo msg &&
-		diff "$TEST_DIRECTORY"/t5100/msg$mail msg$mail &&
+		test_cmp "$TEST_DIRECTORY"/t5100/msg$mail msg$mail &&
 		echo patch &&
-		diff "$TEST_DIRECTORY"/t5100/patch$mail patch$mail &&
+		test_cmp "$TEST_DIRECTORY"/t5100/patch$mail patch$mail &&
 		echo info &&
-		diff "$TEST_DIRECTORY"/t5100/info$mail info$mail"
+		test_cmp "$TEST_DIRECTORY"/t5100/info$mail info$mail
+	'
 done
 
 test_expect_success 'respect NULs' '
 
 	git mailsplit -d3 -o. "$TEST_DIRECTORY"/t5100/nul-plain &&
-	cmp "$TEST_DIRECTORY"/t5100/nul-plain 001 &&
+	test_cmp "$TEST_DIRECTORY"/t5100/nul-plain 001 &&
 	(cat 001 | git mailinfo msg patch) &&
 	test 4 = $(wc -l < patch)
 
@@ -37,9 +38,9 @@ test_expect_success 'respect NULs' '
 test_expect_success 'Preserve NULs out of MIME encoded message' '
 
 	git mailsplit -d5 -o. "$TEST_DIRECTORY"/t5100/nul-b64.in &&
-	cmp "$TEST_DIRECTORY"/t5100/nul-b64.in 00001 &&
+	test_cmp "$TEST_DIRECTORY"/t5100/nul-b64.in 00001 &&
 	git mailinfo msg patch <00001 &&
-	cmp "$TEST_DIRECTORY"/t5100/nul-b64.expect patch
+	test_cmp "$TEST_DIRECTORY"/t5100/nul-b64.expect patch
 
 '
 
diff --git a/t/t7500-commit.sh b/t/t7500-commit.sh
index 86c1647..7ae0bd0 100755
--- a/t/t7500-commit.sh
+++ b/t/t7500-commit.sh
@@ -46,15 +46,24 @@ test_expect_success 'unedited template with comments should not commit' '
 '
 
 test_expect_success 'a Signed-off-by line by itself should not commit' '
-	! GIT_EDITOR="$TEST_DIRECTORY"/t7500/add-signed-off git commit --template "$TEMPLATE"
+	(
+		test_set_editor "$TEST_DIRECTORY"/t7500/add-signed-off &&
+		test_must_fail git commit --template "$TEMPLATE"
+	)
 '
 
 test_expect_success 'adding comments to a template should not commit' '
-	! GIT_EDITOR="$TEST_DIRECTORY"/t7500/add-comments git commit --template "$TEMPLATE"
+	(
+		test_set_editor "$TEST_DIRECTORY"/t7500/add-comments &&
+		test_must_fail git commit --template "$TEMPLATE"
+	)
 '
 
 test_expect_success 'adding real content to a template should commit' '
-	GIT_EDITOR="$TEST_DIRECTORY"/t7500/add-content git commit --template "$TEMPLATE" &&
+	(
+		test_set_editor "$TEST_DIRECTORY"/t7500/add-content &&
+		git commit --template "$TEMPLATE"
+	) &&
 	commit_msg_is "template linecommit message"
 '
 
@@ -62,7 +71,10 @@ test_expect_success '-t option should be short for --template' '
 	echo "short template" > "$TEMPLATE" &&
 	echo "new content" >> foo &&
 	git add foo &&
-	GIT_EDITOR="$TEST_DIRECTORY"/t7500/add-content git commit -t "$TEMPLATE" &&
+	(
+		test_set_editor "$TEST_DIRECTORY"/t7500/add-content &&
+		git commit -t "$TEMPLATE"
+	) &&
 	commit_msg_is "short templatecommit message"
 '
 
@@ -71,7 +83,10 @@ test_expect_success 'config-specified template should commit' '
 	git config commit.template "$TEMPLATE" &&
 	echo "more content" >> foo &&
 	git add foo &&
-	GIT_EDITOR="$TEST_DIRECTORY"/t7500/add-content git commit &&
+	(
+		test_set_editor "$TEST_DIRECTORY"/t7500/add-content &&
+		git commit
+	) &&
 	git config --unset commit.template &&
 	commit_msg_is "new templatecommit message"
 '
@@ -88,8 +103,10 @@ test_expect_success 'commit message from file should override template' '
 	echo "content galore" >> foo &&
 	git add foo &&
 	echo "standard input msg" |
-		GIT_EDITOR="$TEST_DIRECTORY"/t7500/add-content git commit \
-			--template "$TEMPLATE" --file - &&
+	(
+		test_set_editor "$TEST_DIRECTORY"/t7500/add-content &&
+		git commit --template "$TEMPLATE" --file -
+	) &&
 	commit_msg_is "standard input msg"
 '
 
@@ -132,10 +149,12 @@ EOF
 
 test_expect_success '--signoff' '
 	echo "yet another content *narf*" >> foo &&
-	echo "zort" |
-		GIT_EDITOR="$TEST_DIRECTORY"/t7500/add-content git commit -s -F - foo &&
+	echo "zort" | (
+		test_set_editor "$TEST_DIRECTORY"/t7500/add-content &&
+		git commit -s -F - foo
+	) &&
 	git cat-file commit HEAD | sed "1,/^$/d" > output &&
-	diff expect output
+	test_cmp expect output
 '
 
 test_expect_success 'commit message from file (1)' '
-- 
1.6.0.rc2.22.g71b99

  parent reply	other threads:[~2008-08-10  7:34 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-08  5:59 [PATCH 0/3] Enable parallelized tests Johannes Schindelin
2008-08-08  5:59 ` [PATCH 1/3] t9700: remove useless check Johannes Schindelin
2008-08-08  5:59 ` [PATCH 2/3] tests: Clarify dependencies between tests, 'aggregate-results' and 'clean' Johannes Schindelin
2008-08-08  5:59 ` [PATCH 3/3] Enable parallel tests Johannes Schindelin
2008-08-08  6:52   ` Junio C Hamano
2008-08-08 10:26     ` Johannes Schindelin
2008-08-08 10:33       ` Junio C Hamano
2008-08-08  7:44   ` René Scharfe
2008-08-08  8:28     ` Junio C Hamano
2008-08-08  9:31       ` [PATCH] tests: use $TEST_DIRECTORY to refer to the t/ directory Junio C Hamano
2008-08-08 10:35         ` Johannes Schindelin
2008-08-08 10:40           ` Junio C Hamano
2008-08-08 14:40             ` Stephan Beyer
2008-08-09 22:53         ` Olivier Marin
2008-08-09 23:20           ` Junio C Hamano
2008-08-10  7:33           ` Junio C Hamano [this message]
2008-08-08 10:37     ` [PATCH 3/3] Enable parallel tests Johannes Schindelin
2008-08-08 11:08       ` [PATCH 3/3 v2] " Johannes Schindelin
2008-08-08 15:03         ` Stephan Beyer
2008-08-08 15:27           ` Johannes Schindelin
2008-08-08 15:36 ` [PATCH 0/3] Enable parallelized tests SZEDER Gábor
2008-08-08 16:02   ` Stephan Beyer
2008-08-08 16:30     ` Johannes Schindelin
2008-08-08 16:33       ` Stephan Beyer
2008-08-08 16:51         ` Johannes Schindelin
2008-08-08 16:56           ` Stephan Beyer

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=7vvdy92ukh.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=dkr+ml.git@free.fr \
    --cc=git@vger.kernel.org \
    --cc=rene.scharfe@lsrfire.ath.cx \
    /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).