qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: qemu-devel@nongnu.org
Cc: Stefan Hajnoczi <stefanha@redhat.com>,
	Andreas Faerber <afaerber@suse.de>,
	Anthony Liguori <aliguori@amazon.com>,
	Marcel Apfelbaum <marcel.a@redhat.com>
Subject: [Qemu-devel] [PATCH 1/2] tests: show the name of each executing qtest
Date: Thu, 13 Mar 2014 10:41:33 +0100	[thread overview]
Message-ID: <1394703694-3281-2-git-send-email-stefanha@redhat.com> (raw)
In-Reply-To: <1394703694-3281-1-git-send-email-stefanha@redhat.com>

When a qtest fails only the assertion failure is printed but you do not
know which qtest binary was running:

  GTESTER check-qtest-x86_64
  main-loop: WARNING: I/O thread spun for 1000 iterations
  blkdebug: Suspended request 'A'
  blkdebug: Resuming request 'A'

check-qtest-x86_64 is actually a make target and not a gtester binary.
The make target includes over 20 separate qtest binaries.

The name of each executing qtest binary should be displayed:

  GTESTER tests/fdc-test
  main-loop: WARNING: I/O thread spun for 1000 iterations
  GTESTER tests/ide-test
  blkdebug: Suspended request 'A'
  blkdebug: Resuming request 'A'

This makes it easy to identify the failing test.

I tried out different ways of displaying qtest binary names.  This patch
implements the best (working) approach I found.  It generates a long
shell command joined with && to execute each qtest binary and print its
name.

This solution is ugly because it doesn't reuse quiet-command.  Maybe a
GNU Make guru will be able to use $(eval) to solve this, but I ended up
with a mix of shell and $(foreach).

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 tests/Makefile | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/tests/Makefile b/tests/Makefile
index b17d41e..d80112a 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -281,9 +281,12 @@ GCOV_OPTIONS = -n $(if $(V),-f,)
 .PHONY: $(patsubst %, check-qtest-%, $(QTEST_TARGETS))
 $(patsubst %, check-qtest-%, $(QTEST_TARGETS)): check-qtest-%: $(check-qtest-y)
 	$(if $(CONFIG_GCOV),@rm -f *.gcda */*.gcda */*/*.gcda */*/*/*.gcda,)
-	$(call quiet-command,QTEST_QEMU_BINARY=$*-softmmu/qemu-system-$* \
+	@true $(foreach qtest-binary, $(check-qtest-$*-y), \
+		&& echo "GTESTER $(qtest-binary)" && \
+		QTEST_QEMU_BINARY=$*-softmmu/qemu-system-$* \
 		MALLOC_PERTURB_=$${MALLOC_PERTURB_:-$$((RANDOM % 255 + 1))} \
-		gtester $(GTESTER_OPTIONS) -m=$(SPEED) $(check-qtest-$*-y),"GTESTER $@")
+		gtester $(GTESTER_OPTIONS) -m=$(SPEED) $(qtest-binary) \
+	)
 	$(if $(CONFIG_GCOV),@for f in $(gcov-files-$*-y); do \
 	  echo Gcov report for $$f:;\
 	  $(GCOV) $(GCOV_OPTIONS) $$f -o `dirname $$f`; \
-- 
1.8.5.3

  reply	other threads:[~2014-03-13  9:41 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-13  9:41 [Qemu-devel] [PATCH 0/2] qtest: crash fix and improved "make check" output Stefan Hajnoczi
2014-03-13  9:41 ` Stefan Hajnoczi [this message]
2014-03-13  9:41 ` [Qemu-devel] [PATCH 2/2] qtest: fix crash if SIGABRT during qtest_init() Stefan Hajnoczi
2014-03-13 11:07   ` Marcel Apfelbaum
2014-03-13 12:58     ` Stefan Hajnoczi
2014-03-13 20:10   ` Andreas Färber
2014-03-27 13:09   ` Markus Armbruster
2014-03-27 13:12     ` Andreas Färber
2014-03-27 13:34       ` Marcel Apfelbaum
2014-03-27 13:37         ` Stefan Hajnoczi
2014-03-27 14:02           ` Markus Armbruster
2014-03-27 14:03             ` Stefan Hajnoczi
2014-03-27 13:36       ` Stefan Hajnoczi
2014-03-13 11:07 ` [Qemu-devel] [PATCH 0/2] qtest: crash fix and improved "make check" output Marcel Apfelbaum

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=1394703694-3281-2-git-send-email-stefanha@redhat.com \
    --to=stefanha@redhat.com \
    --cc=afaerber@suse.de \
    --cc=aliguori@amazon.com \
    --cc=marcel.a@redhat.com \
    --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).