diff mbox series

[139/142] meson: convert check-block

Message ID 20200128175342.9066-140-pbonzini@redhat.com
State New
Headers show
Series Proof of concept for Meson integration | expand

Commit Message

Paolo Bonzini Jan. 28, 2020, 5:53 p.m. UTC
---
 meson.build                    |  1 +
 tests/Makefile.include         | 24 +++---------------------
 tests/meson.build              |  3 +++
 tests/qemu-iotests/meson.build |  8 ++++++++
 4 files changed, 15 insertions(+), 21 deletions(-)
 create mode 100644 tests/meson.build
 create mode 100644 tests/qemu-iotests/meson.build
diff mbox series

Patch

diff --git a/meson.build b/meson.build
index 6083897fc7..af25a130f2 100644
--- a/meson.build
+++ b/meson.build
@@ -1093,3 +1093,4 @@  endif
 if 'CONFIG_GTK' in config_host
   subdir('po')
 endif
+subdir('tests')
diff --git a/tests/Makefile.include b/tests/Makefile.include
index d40e666311..86da369aa0 100644
--- a/tests/Makefile.include
+++ b/tests/Makefile.include
@@ -147,8 +147,6 @@  check-unit-y += tests/test-uuid$(EXESUF)
 check-unit-y += tests/ptimer-test$(EXESUF)
 check-unit-y += tests/test-qapi-util$(EXESUF)
 
-check-block-$(call land,$(CONFIG_POSIX),$(CONFIG_SOFTMMU)) += tests/check-block.sh
-
 # All QTests for now are POSIX-only, but the dependencies are
 # really in libqtest, not in the testcases themselves.
 
@@ -827,7 +825,6 @@  tests/usb-hcd-ehci-test$(EXESUF): tests/usb-hcd-ehci-test.o $(libqos-usb-obj-y)
 tests/usb-hcd-xhci-test$(EXESUF): tests/usb-hcd-xhci-test.o $(libqos-usb-obj-y)
 tests/cpu-plug-test$(EXESUF): tests/cpu-plug-test.o
 tests/migration-test$(EXESUF): tests/migration-test.o
-tests/qemu-iotests/socket_scm_helper$(EXESUF): tests/qemu-iotests/socket_scm_helper.o
 tests/test-qemu-opts$(EXESUF): tests/test-qemu-opts.o $(test-util-obj-y)
 tests/test-keyval$(EXESUF): tests/test-keyval.o $(test-util-obj-y) $(test-qapi-obj-y)
 tests/test-write-threshold$(EXESUF): tests/test-write-threshold.o $(test-block-obj-y)
@@ -1118,14 +1115,6 @@  clean-tcg: $(CLEAN_TCG_TARGET_RULES)
 
 # Other tests
 
-QEMU_IOTESTS_HELPERS-$(call land,$(CONFIG_SOFTMMU),$(CONFIG_LINUX)) = tests/qemu-iotests/socket_scm_helper$(EXESUF)
-
-.PHONY: check-tests/check-block.sh
-check-tests/check-block.sh: tests/check-block.sh qemu-img$(EXESUF) \
-		qemu-io$(EXESUF) qemu-nbd$(EXESUF) $(QEMU_IOTESTS_HELPERS-y) \
-		$(patsubst %-softmmu,qemu-system-%,$(filter %-softmmu,$(TARGET_DIRS)))
-	@$<
-
 .PHONY: check-tests/qapi-schema/frontend
 check-tests/qapi-schema/frontend: $(addprefix $(SRC_PATH)/, $(check-qapi-schema-y))
 	$(call quiet-command, PYTHONPATH=$(SRC_PATH)/scripts \
@@ -1182,25 +1171,18 @@  check-acceptance: check-venv $(TESTS_RESULTS_DIR)
 
 # Consolidated targets
 
-.PHONY: check-block check-qapi-schema check-qtest check-unit check check-clean
+.PHONY: check-qapi-schema check-qtest check-unit check check-clean
 check-qapi-schema: check-tests/qapi-schema/frontend check-tests/qapi-schema/doc-good.texi
 check-qtest: $(patsubst %,check-qtest-%, $(QTEST_TARGETS))
-ifeq ($(CONFIG_TOOLS),y)
-check-block: $(patsubst %,check-%, $(check-block-y))
-endif
-check: check-block check-qapi-schema check-unit check-softfloat check-qtest check-decodetree
+check: check-qapi-schema check-unit check-softfloat check-qtest check-decodetree
 check-clean:
-	rm -rf $(check-unit-y) tests/*.o $(QEMU_IOTESTS_HELPERS-y)
+	rm -rf $(check-unit-y) tests/*.o
 	rm -rf $(sort $(foreach target,$(SYSEMU_TARGET_LIST), $(check-qtest-$(target)-y)) $(check-qtest-generic-y))
 	rm -f tests/test-qapi-gen-timestamp
 	rm -rf $(TESTS_VENV_DIR) $(TESTS_RESULTS_DIR)
 
 clean: check-clean
 
-# Build the help program automatically
-
-all: $(QEMU_IOTESTS_HELPERS-y)
-
 -include $(wildcard tests/*.d)
 -include $(wildcard tests/libqos/*.d)
 
diff --git a/tests/meson.build b/tests/meson.build
new file mode 100644
index 0000000000..a546d91c17
--- /dev/null
+++ b/tests/meson.build
@@ -0,0 +1,3 @@ 
+if have_system and 'CONFIG_POSIX' in config_host
+  subdir('qemu-iotests')
+endif
diff --git a/tests/qemu-iotests/meson.build b/tests/qemu-iotests/meson.build
new file mode 100644
index 0000000000..6509b18044
--- /dev/null
+++ b/tests/qemu-iotests/meson.build
@@ -0,0 +1,8 @@ 
+dep = [qemu_img, qemu_io, qemu_nbd, emulators]
+if 'CONFIG_LINUX' in config_host
+    dep += executable('socket_scm_helper', 'socket_scm_helper.c',
+                      build_by_default: false)
+endif
+test('qemu-iotests', files('../check-block.sh'), depends: dep,
+     suite: 'block')
+