tests: avoid running duplicate qom-tests
PATCH 1/1 tests: avoid running duplicate qom-tests
Since 3687d532 we've been unconditionally adding qom-test to our qtests for every arch. However, some archs inherit their tests from Makefile variables for other archs, such as i386/x86_64, microblaze/microblazeel, and xtensa/xtensaeb. Since these are evaluated in a lazy manner, we ultimately end up adding qom-test twice.
In the case x86_64, where we have a large number of machine types that we rerun qom-test for, this has lead to a fairly noticeable increase in the overall run-time of make check (78s vs. 42s on my machine). Similar speed-ups are visible for other such archs, but not nearly as significant.
Fix this by only adding qom-test to an arch's test list if it's not already present.
--- tests/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
tests/Makefile +2 -1
@@ -192,7 +192,8 @@ check-qtest-xtensaeb-y = $(check-qtest-xtensa-y) # qom-test works for all sysemu architectures: $(foreach target,$(SYSEMU_TARGET_LIST), \ - $(eval check-qtest-$(target)-y += tests/qom-test$(EXESUF))) + $(if $(findstring tests/qom-test$(EXESUF), $(check-qtest-$(target)-y)),, \ + $(eval check-qtest-$(target)-y += tests/qom-test$(EXESUF)))) check-qapi-schema-y := $(addprefix tests/qapi-schema/, \ comments.json empty.json funny-char.json indented-expr.json \
Signature · 1 line
1.9.1
Quoted 25 lines · Michael Roth
Since
3687d532we've been unconditionally adding qom-test to our qtests for every arch. However, some archs inherit their tests fromMakefilevariables for other archs, such as i386/x86_64, microblaze/microblazeel, and xtensa/xtensaeb. Since these are evaluated in a lazy manner, we ultimately end up adding qom-test twice.In the case
x86_64, where we have a large number of machine types that we rerun qom-test for, this has lead to a fairly noticeable increase in the overall run-time ofmake check(78s vs. 42s on my machine). Similar speed-ups are visible for other such archs, but not nearly as significant.Fix this by only adding qom-test to an arch's test list if it's not already present.
Signed-off-by Michael Roth <[email protected]>--- tests/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)tests/Makefile +0
-0
tests/Makefile check-qtest-xtensaeb-y = $(check-qtest-xtensa-y) · line 196
Quoted 6 lines
tests/Makefile +2
-1@@ -192,7 +192,8 @@ check-qtest-xtensaeb-y = $(check-qtest-xtensa-y) # qom-test works for all sysemu architectures: $(foreach target,$(SYSEMU_TARGET_LIST), \ - $(eval check-qtest-$(target)-y += tests/qom-test$(EXESUF))) + $(if $(findstring tests/qom-test$(EXESUF), $(check-qtest-$(target)-y)),, \ + $(eval check-qtest-$(target)-y += tests/qom-test$(EXESUF))))
See also Andreas' suggested fix:
https://lists.gnu.org/archive/html/qemu-devel/2014-04/msg01087.html
and mine:
https://lists.gnu.org/archive/html/qemu-devel/2014-03/msg05771.html
Andreas didn't like my patch because it sorts all the tests as a side effect, and I didn't like the hard-coded listing of architectures in Andreas' patch. It looks like maybe your version will satisfy both of us :-)
thanks
-- PMM
Michael Tokarev
AppliedApplied to -trivial, I overlooked it initially, not reading Peter's comments thinkfully. Thank you!
/mjt