[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC v2 05/20] tests: Add rules to non-gtester qtest test c
From: |
Eduardo Habkost |
Subject: |
[Qemu-devel] [RFC v2 05/20] tests: Add rules to non-gtester qtest test cases |
Date: |
Fri, 25 Nov 2016 20:05:41 -0200 |
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 <address@hidden>
---
Changes v1 -> v2:
* Change "define qtest-target =" to "define qtest-target"
to make older versions of GNU Make happy
* Print QTEST-<arch> when running QTEST tests
---
tests/Makefile.include | 37 ++++++++++++++++++++++++++++++++++++-
1 file changed, 36 insertions(+), 1 deletion(-)
diff --git a/tests/Makefile.include b/tests/Makefile.include
index e98d3b6..63c4347 100644
--- a/tests/Makefile.include
+++ b/tests/Makefile.include
@@ -791,6 +791,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)
@@ -818,7 +852,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.7.4
- [Qemu-devel] [RFC v2 00/20] qmp: Report bus information on 'query-machines', Eduardo Habkost, 2016/11/25
- [Qemu-devel] [RFC v2 01/20] qemu.py: Make logging optional, Eduardo Habkost, 2016/11/25
- [Qemu-devel] [RFC v2 02/20] qtest.py: Support QTEST_LOG environment variable, Eduardo Habkost, 2016/11/25
- [Qemu-devel] [RFC v2 03/20] qtest.py: make logging optional, Eduardo Habkost, 2016/11/25
- [Qemu-devel] [RFC v2 04/20] qtest.py: Make 'binary' parameter optional, Eduardo Habkost, 2016/11/25
- [Qemu-devel] [RFC v2 05/20] tests: Add rules to non-gtester qtest test cases,
Eduardo Habkost <=
- [Qemu-devel] [RFC v2 06/20] qdev: Add 'accepted-device-types' property to BusClass, Eduardo Habkost, 2016/11/25
- [Qemu-devel] [RFC v2 08/20] virtio-pci: Set PCIDeviceClass::is_express=1, Eduardo Habkost, 2016/11/25
- [Qemu-devel] [RFC v2 07/20] qmp: Add 'always-available-buses' field to 'query-machines', Eduardo Habkost, 2016/11/25
- [Qemu-devel] [RFC v2 09/20] vmxnet3: Set PCIDeviceClass::is_express=1, Eduardo Habkost, 2016/11/25
- [Qemu-devel] [RFC v2 10/20] pvscsi: Set PCIDeviceClass::is_express=1, Eduardo Habkost, 2016/11/25
- [Qemu-devel] [RFC v2 11/20] pci: INTERFACE_LEGACY_PCI_DEVICE and INTERFACE_PCIE_DEVICE interfaces, Eduardo Habkost, 2016/11/25
- [Qemu-devel] [RFC v2 13/20] [trivial] edu: Move edu_info outside function, Eduardo Habkost, 2016/11/25
- [Qemu-devel] [RFC v2 12/20] pci: Replace is_express with INTERFACE_PCIE_DEVICE, Eduardo Habkost, 2016/11/25