qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH RFC] tests: Run qtest cases in parallel


From: Fam Zheng
Subject: [Qemu-devel] [PATCH RFC] tests: Run qtest cases in parallel
Date: Fri, 12 Aug 2016 17:19:34 +0800

Previously all test cases in a category, such as check-qtest-y, are
executed in a single long gtester command. This patch separates each
test into its own make target to allow better parallism.

Signed-off-by: Fam Zheng <address@hidden>
---

This saves 50% of the time "make check takes" compared to on master
(I use -j8). RFC because I'm not sure if the new gcov usage is correct
with the now much higher level of parallism compared to before.
---
 tests/Makefile.include | 34 ++++++++++++++++++----------------
 1 file changed, 18 insertions(+), 16 deletions(-)

diff --git a/tests/Makefile.include b/tests/Makefile.include
index 14be491..9bf0326 100644
--- a/tests/Makefile.include
+++ b/tests/Makefile.include
@@ -691,27 +691,29 @@ GCOV_OPTIONS = -n $(if $(V),-f,)
 # gtester tests, possibly with verbose output
 
 .PHONY: $(patsubst %, check-qtest-%, $(QTEST_TARGETS))
-$(patsubst %, check-qtest-%, $(QTEST_TARGETS)): check-qtest-%: $(check-qtest-y)
+
+qtest-run-%: tests/%
        $(if $(CONFIG_GCOV),@rm -f *.gcda */*.gcda */*/*.gcda */*/*/*.gcda,)
-       $(call quiet-command,QTEST_QEMU_BINARY=$*-softmmu/qemu-system-$* \
+       $(call quiet-command,\
+               $(if $(QTEST_TARGET), \
+                       
QTEST_QEMU_BINARY=$(QTEST_TARGET)-softmmu/qemu-system-$(QTEST_TARGET)) \
                QTEST_QEMU_IMG=qemu-img$(EXESUF) \
                MALLOC_PERTURB_=$${MALLOC_PERTURB_:-$$((RANDOM % 255 + 1))} \
-               gtester $(GTESTER_OPTIONS) -m=$(SPEED) $(check-qtest-$*-y) 
$(check-qtest-generic-y),"GTESTER $@")
-       $(if $(CONFIG_GCOV),@for f in $(gcov-files-$*-y) 
$(gcov-files-generic-y); do \
-         echo Gcov report for $$f:;\
-         $(GCOV) $(GCOV_OPTIONS) $$f -o `dirname $$f`; \
-       done,)
+               gtester $< $(GTESTER_OPTIONS) -m=$(SPEED),"GTESTER $<")
+       $(if $(CONFIG_GCOV), @echo Gcov report for $<:;\
+         $(GCOV) $(GCOV_OPTIONS) $< -o `dirname $<`; \
+       )
+
+$(foreach target, $(QTEST_TARGETS), \
+       $(eval check-qtest-$(target): QTEST_TARGET := $(target)) \
+       $(eval check-qtest-$(target): $(patsubst tests/%, qtest-run-%, \
+                                             $(check-qtest-y) \
+                                             $(check-qtest-$(target)-y) \
+                                             $(check-qtest-generic-y))) \
+)
 
 .PHONY: $(patsubst %, check-%, $(check-unit-y))
-$(patsubst %, check-%, $(check-unit-y)): check-%: %
-       $(if $(CONFIG_GCOV),@rm -f *.gcda */*.gcda */*/*.gcda */*/*/*.gcda,)
-       $(call quiet-command, \
-               MALLOC_PERTURB_=$${MALLOC_PERTURB_:-$$((RANDOM % 255 + 1))} \
-               gtester $(GTESTER_OPTIONS) -m=$(SPEED) $*,"GTESTER $*")
-       $(if $(CONFIG_GCOV),@for f in $(gcov-files-$(subst tests/,,$*)-y) 
$(gcov-files-generic-y); do \
-         echo Gcov report for $$f:;\
-         $(GCOV) $(GCOV_OPTIONS) $$f -o `dirname $$f`; \
-       done,)
+$(patsubst %, check-%, $(check-unit-y)): check-tests/%: qtest-run-%
 
 # gtester tests with XML output
 
-- 
2.7.4




reply via email to

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