qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 1/2] tests: show the name of each executing qtest


From: Stefan Hajnoczi
Subject: [Qemu-devel] [PATCH 1/2] tests: show the name of each executing qtest
Date: Thu, 13 Mar 2014 10:41:33 +0100

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 <address@hidden>
---
 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 via email to

[Prev in Thread] Current Thread [Next in Thread]