From: Eduardo Habkost <ehabkost@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 8/9] tests: Add rules to non-gtester qtest test cases
Date: Mon, 16 Jan 2017 23:02:03 -0200 [thread overview]
Message-ID: <20170117010204.4909-9-ehabkost@redhat.com> (raw)
In-Reply-To: <20170117010204.4909-1-ehabkost@redhat.com>
Today, simple non-gtester binaries can be run easily by a single
Makefile rule (e.g. check-tests/qemu-iotest-quick.sh), but we
don't have anything to help us automatically run the same test
binary for multiple architectures.
This add check-simpleqtest-* rules that will help us run binaries
present in $(check-simpleqtest-*-y).
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
Patch originally submitted as part of series:
* [RFC v2 00/20] qmp: Report bus information on 'query-machines'
---
tests/Makefile.include | 37 ++++++++++++++++++++++++++++++++++++-
1 file changed, 36 insertions(+), 1 deletion(-)
diff --git a/tests/Makefile.include b/tests/Makefile.include
index 202901374c..d9809c6229 100644
--- a/tests/Makefile.include
+++ b/tests/Makefile.include
@@ -795,6 +795,40 @@ check-report.html: check-report.xml
$(call quiet-command,gtester-report $< > $@,"GEN","$@")
+# rules for non-gtester qtest tests:
+
+SIMPLETEST_OPTIONS = $(if $(V),--verbose,--quiet)
+
+# rule dependencies are:
+# check-simpleqtest: check-simpleqtest-$(ARCH) for each ARCH in QTEST_ARCH
+# check-simpleqtest-$(ARCH): check-simpleqtest-$(TEST)-$(ARCH) for each
+# TEST in $(check-simpleqtest-$(ARCH)-y)
+# (generated by qtest_target macro)
+# check-simpleqtest-$(TEST)-$(ARCH): runs test with $(SIMPLETEST_OPTIONS)
+# (generated by qtest_target macro)
+#
+# $(check-simpleqtest-$(ARCH)-y) automatically includes
+# $(check-simpleqtest-generic-y)
+
+define qtest-target
+
+check-simpleqtest-$(1)-y += $$(check-simpleqtest-generic-y)
+
+.PHONY: $$(patsubst %, check-simpleqtest-%-$(1), $$(check-simpleqtest-$(1)-y))
+$$(patsubst %, check-simpleqtest-%-$(1), $$(check-simpleqtest-$(1)-y)): check-simpleqtest-%-$(1): %
+ $$(call quiet-command,QTEST_QEMU_BINARY=$(1)-softmmu/qemu-system-$(1) \
+ QTEST_QEMU_IMG=qemu-img$$(EXESUF) \
+ MALLOC_PERTURB_=$${MALLOC_PERTURB_:-$$((RANDOM % 255 + 1))} \
+ $$< $$(SIMPLETEST_OPTIONS),"QTEST-$(1)", "$$<")
+
+.PHONY: check-simpleqtest-$(1)
+check-simpleqtest-$(1): $$(patsubst %, check-simpleqtest-%-$(1), $$(check-simpleqtest-$(1)-y))
+
+endef
+
+$(foreach TARGET,$(QTEST_TARGETS),$(eval $(call qtest-target,$(TARGET))))
+
+
# Other tests
QEMU_IOTESTS_HELPERS-$(CONFIG_LINUX) = tests/qemu-iotests/socket_scm_helper$(EXESUF)
@@ -822,7 +856,8 @@ $(patsubst %, check-%, $(check-qapi-schema-y)): check-%.json: $(SRC_PATH)/%.json
.PHONY: check-qapi-schema check-qtest check-unit check check-clean
check-qapi-schema: $(patsubst %,check-%, $(check-qapi-schema-y))
-check-qtest: $(patsubst %,check-qtest-%, $(QTEST_TARGETS))
+check-simpleqtest: $(patsubst %,check-simpleqtest-%, $(QTEST_TARGETS))
+check-qtest: $(patsubst %,check-qtest-%, $(QTEST_TARGETS)) check-simpleqtest
check-unit: $(patsubst %,check-%, $(check-unit-y))
check-block: $(patsubst %,check-%, $(check-block-y))
check: check-qapi-schema check-unit check-qtest
--
2.11.0.259.g40922b1
next prev parent reply other threads:[~2017-01-17 1:02 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-17 1:01 [Qemu-devel] [PATCH 0/9] i386: query-cpu-model-expansion test script Eduardo Habkost
2017-01-17 1:01 ` [Qemu-devel] [PATCH 1/9] target-i386: Move "host" properties to base class Eduardo Habkost
2017-01-17 1:01 ` [Qemu-devel] [PATCH 2/9] target-i386: Allow short strings to be used as vendor ID Eduardo Habkost
2017-01-17 1:01 ` [Qemu-devel] [PATCH 3/9] cpu: Support comma escaping when parsing -cpu Eduardo Habkost
2017-01-17 1:01 ` [Qemu-devel] [PATCH 4/9] qemu.py: Make logging optional Eduardo Habkost
2017-01-17 1:02 ` [Qemu-devel] [PATCH 5/9] qtest.py: Support QTEST_LOG environment variable Eduardo Habkost
2017-01-17 1:02 ` [Qemu-devel] [PATCH 6/9] qtest.py: make logging optional Eduardo Habkost
2017-01-17 1:02 ` [Qemu-devel] [PATCH 7/9] qtest.py: Make 'binary' parameter optional Eduardo Habkost
2017-01-17 1:02 ` Eduardo Habkost [this message]
2017-01-17 1:02 ` [Qemu-devel] [PATCH 9/9] tests: Test case for query-cpu-model-expansion Eduardo Habkost
2017-01-18 9:39 ` David Hildenbrand
2017-01-18 12:39 ` Eduardo Habkost
2017-01-18 12:42 ` David Hildenbrand
2017-01-17 1:21 ` [Qemu-devel] [PATCH 0/9] i386: query-cpu-model-expansion test script no-reply
2017-01-17 15:22 ` Jason J. Herne
2017-01-18 17:00 ` Eduardo Habkost
2017-01-18 17:09 ` [Qemu-devel] [libvirt] " Jason J. Herne
2017-01-18 17:34 ` Eduardo Habkost
2017-01-18 19:18 ` David Hildenbrand
2017-01-19 10:48 ` Eduardo Habkost
2017-01-19 17:21 ` David Hildenbrand
2017-01-19 17:45 ` Daniel P. Berrange
2017-01-20 14:30 ` David Hildenbrand
2017-01-20 18:33 ` Eduardo Habkost
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=20170117010204.4909-9-ehabkost@redhat.com \
--to=ehabkost@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).