qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: qemu-devel@nongnu.org
Cc: qemu-arm@nongnu.org, "Alex Bennée" <alex.bennee@linaro.org>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>
Subject: [Qemu-devel] [PATCH v1 3/5] tests/tcg: fix diff-out pass to properly report failure
Date: Fri,  5 Jul 2019 17:04:19 +0100	[thread overview]
Message-ID: <20190705160421.19015-4-alex.bennee@linaro.org> (raw)
In-Reply-To: <20190705160421.19015-1-alex.bennee@linaro.org>

A side effect of piping the output to head is squash the exit status
of the diff command. Fix this by only doing the pipe if the diff
failed and then ensuring the status is non-zero.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 tests/tcg/Makefile | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/tests/tcg/Makefile b/tests/tcg/Makefile
index 6fa63cc8d5..7973cd1ba2 100644
--- a/tests/tcg/Makefile
+++ b/tests/tcg/Makefile
@@ -45,7 +45,11 @@ run-test = $(call quiet-command, timeout $(TIMEOUT) $2,"TEST",$3)
 endif
 
 # $1 = test name, $2 = reference
-diff-out = $(call quiet-command, diff -u $1.out $2 | head -n 10,"DIFF","$1.out with $2")
+# to work around the pipe squashing the status we only pipe the result if
+# we know it failed and then force failure at the end.
+diff-out = $(call quiet-command, diff -q $1.out $2 || \
+				 (diff -u $1.out $2 | head -n 10 && false), \
+				 "DIFF","$1.out with $2")
 
 # $1 = test name, $2 = reason
 skip-test = @printf "  SKIPPED %s on $(TARGET_NAME) because %s\n" $1 $2
-- 
2.20.1



  parent reply	other threads:[~2019-07-05 16:15 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-05 16:04 [Qemu-devel] [PATCH for 4.1 0/5] tcg tests and gdbstub fixes Alex Bennée
2019-07-05 16:04 ` [Qemu-devel] [PATCH v1 1/5] target/arm/vfp_helper: Call set_fpscr_to_host before updating FPSCR reg Alex Bennée
2019-07-05 16:04 ` [Qemu-devel] [PATCH v1 2/5] tests/tcg: fix up test-i386-fprem.ref generation Alex Bennée
2019-07-10  6:58   ` Richard Henderson
2019-07-10 10:41   ` Philippe Mathieu-Daudé
2019-07-10 11:32     ` Alex Bennée
2019-07-05 16:04 ` Alex Bennée [this message]
2019-07-10  7:41   ` [Qemu-devel] [PATCH v1 3/5] tests/tcg: fix diff-out pass to properly report failure Richard Henderson
2019-07-10  8:38     ` Alex Bennée
2019-07-05 16:04 ` [Qemu-devel] [PATCH v1 4/5] gdbstub: add some notes to the header comment Alex Bennée
2019-07-05 16:14   ` Philippe Mathieu-Daudé
2019-07-10  7:14   ` Richard Henderson
2019-07-10 15:28     ` Alex Bennée
2019-07-05 16:04 ` [Qemu-devel] [PATCH v1 5/5] gdbstub: revert to previous set_reg behaviour Alex Bennée
2019-07-10  7:15   ` Richard Henderson
2019-07-10  9:17   ` Aleksandar Markovic
2019-07-10  9:30     ` Alex Bennée
2019-07-10  9:33       ` Aleksandar Markovic

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=20190705160421.19015-4-alex.bennee@linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=f4bug@amsat.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.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).