From: "Alex Bennée" <alex.bennee@linaro.org>
To: peter.maydell@linaro.org
Cc: "Alex Bennée" <alex.bennee@linaro.org>,
qemu-devel@nongnu.org, "Philippe Mathieu-Daudé" <f4bug@amsat.org>
Subject: [Qemu-devel] [PULL 2/4] tests/tcg: fix diff-out pass to properly report failure
Date: Wed, 10 Jul 2019 11:25:55 +0100 [thread overview]
Message-ID: <20190710102557.3107-3-alex.bennee@linaro.org> (raw)
In-Reply-To: <20190710102557.3107-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>
diff --git a/tests/tcg/Makefile b/tests/tcg/Makefile
index 6fa63cc8d5..9f56768624 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
next prev parent reply other threads:[~2019-07-10 10:28 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-10 10:25 [Qemu-devel] [PULL for 4.1 0/4] testing and gdbstub fixes Alex Bennée
2019-07-10 10:25 ` [Qemu-devel] [PULL 1/4] tests/tcg: fix up test-i386-fprem.ref generation Alex Bennée
2019-07-10 10:25 ` Alex Bennée [this message]
2019-07-10 10:25 ` [Qemu-devel] [PULL 3/4] gdbstub: add some notes to the header comment Alex Bennée
2019-07-10 10:25 ` [Qemu-devel] [PULL 4/4] gdbstub: revert to previous set_reg behaviour Alex Bennée
2019-07-11 10:57 ` [Qemu-devel] [PULL for 4.1 0/4] testing and gdbstub fixes Peter Maydell
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=20190710102557.3107-3-alex.bennee@linaro.org \
--to=alex.bennee@linaro.org \
--cc=f4bug@amsat.org \
--cc=peter.maydell@linaro.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).