Re: no-xmailer tests fail under Mac OS

Subsystems: the rest

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: no-xmailer tests fail under Mac OS

From: Junio C Hamano <hidden>
Date: 2016-06-15 23:03:16

Jeff King [off-list ref] writes:
On Fri, Dec 05, 2014 at 11:07:37PM -0800, Michael Blume wrote:
quoted
quoted
Ah, right, we might be looking for 0 sometimes. The right way to do it
without destroying the &&-chaining is:

  { grep ^X-Mailer: out || true } &&
  test_line_count = $expected mailer
Hmm, it doesn't look like that helper is &&-chained though? So it
seems like we could just do without the &&
You're right, but that is IMHO a bug. We would not notice if send-email
or format-patch barfed, and we are expecting to find no X-Mailer (we
wouldn't, but for the wrong reason).
Let me patch this up further by amending the SQUASH??? at the tip.

 t/t9001-send-email.sh | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh
index bb573ef..7826aa8 100755
--- a/t/t9001-send-email.sh
+++ b/t/t9001-send-email.sh
@@ -1408,18 +1408,17 @@ test_expect_success $PREREQ 'sendemail.aliasfile=~/.mailrc' '
 '
 
 do_xmailer_test() {
-	expected=$1
-	params=$2
-	git format-patch -1
+	expected=$1 params=$2 &&
+	git format-patch -1 &&
 	git send-email \
 		--from="Example <nobody@example.com>" \
 		--to=someone@example.com \
 		--smtp-server="$(pwd)/fake.sendmail" \
 		$params \
 		0001-*.patch \
-		2>errors >out
-	test "z$(grep ^X-Mailer: out | wc -l)" = "z$expected"
-	return $?
+		2>errors >out &&
+	{ grep '^X-Mailer:' out || :; } >mailer &&
+	test_line_count = $expected mailer
 }
 
 test_expect_success $PREREQ '--[no-]xmailer without any configuration' '

Re: no-xmailer tests fail under Mac OS

From: Jeff King <hidden>
Date: 2016-06-15 23:03:16

On Thu, Dec 11, 2014 at 02:11:04PM -0800, Junio C Hamano wrote:
Jeff King [off-list ref] writes:
quoted
On Fri, Dec 05, 2014 at 11:07:37PM -0800, Michael Blume wrote:
quoted
quoted
Ah, right, we might be looking for 0 sometimes. The right way to do it
without destroying the &&-chaining is:

  { grep ^X-Mailer: out || true } &&
  test_line_count = $expected mailer
Hmm, it doesn't look like that helper is &&-chained though? So it
seems like we could just do without the &&
You're right, but that is IMHO a bug. We would not notice if send-email
or format-patch barfed, and we are expecting to find no X-Mailer (we
wouldn't, but for the wrong reason).
Let me patch this up further by amending the SQUASH??? at the tip.

 t/t9001-send-email.sh | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
[...]
Yeah, looks good to me.

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help