[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 45/46] tests/Makefile.include: add [build|clean|c
From: |
Alex Bennée |
Subject: |
[Qemu-devel] [PATCH v3 45/46] tests/Makefile.include: add [build|clean|check]-tcg targets |
Date: |
Tue, 24 Apr 2018 16:24:04 +0100 |
This will ensure all linux-user targets build their guest test
programs and ensure check-tcg will run the respective tests.
Signed-off-by: Alex Bennée <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Tested-by: Philippe Mathieu-Daudé <address@hidden>
---
v2
- use -include instead of complex macro stuff
- also include TARGET_BASE_ARCH/Makefile
v3
- add build-tcg, make check-tcg actually run tests
---
tests/Makefile.include | 26 ++++++++++++++++++++++-
tests/tcg/Makefile.include | 43 ++++++++++++++++++++++----------------
2 files changed, 50 insertions(+), 19 deletions(-)
diff --git a/tests/Makefile.include b/tests/Makefile.include
index 3d2f0458ab..310ccefdd9 100644
--- a/tests/Makefile.include
+++ b/tests/Makefile.include
@@ -10,6 +10,7 @@ check-help:
@echo " $(MAKE) check-speed Run qobject speed tests"
@echo " $(MAKE) check-qapi-schema Run QAPI schema tests"
@echo " $(MAKE) check-block Run block tests"
+ @echo " $(MAKE) check-tcg Run TCG tests"
@echo " $(MAKE) check-report.html Generates an HTML test report"
@echo " $(MAKE) check-clean Clean the tests"
@echo
@@ -916,6 +917,30 @@ check-report.xml: $(patsubst %,check-report-qtest-%.xml,
$(QTEST_TARGETS)) check
check-report.html: check-report.xml
$(call quiet-command,gtester-report $< > $@,"GEN","$@")
+# Per guest TCG tests
+
+LINUX_USER_TARGETS=$(filter %-linux-user,$(TARGET_LIST))
+BUILD_TCG_TARGET_RULES=$(patsubst %,build-tcg-tests-%, $(LINUX_USER_TARGETS))
+CLEAN_TCG_TARGET_RULES=$(patsubst %,clean-tcg-tests-%, $(LINUX_USER_TARGETS))
+RUN_TCG_TARGET_RULES=$(patsubst %,run-tcg-tests-%, $(LINUX_USER_TARGETS))
+
+build-tcg-tests-%:
+ $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $* V="$(V)"
TARGET_DIR="$*/" guest-tests,)
+
+run-tcg-tests-%: build-tcg-tests-%
+ $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $* V="$(V)"
TARGET_DIR="$*/" run-guest-tests,)
+
+clean-tcg-tests-%:
+ $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $* V="$(V)"
TARGET_DIR="$*/" clean-guest-tests,)
+
+.PHONY: build-tcg
+build-tcg: $(BUILD_TCG_TARGET_RULES)
+
+.PHONY: check-tcg
+check-tcg: $(RUN_TCG_TARGET_RULES)
+
+.PHONY: clean-tcg
+clean-tcg: $(CLEAN_TCG_TARGET_RULES)
# Other tests
@@ -958,7 +983,6 @@ check-speed: $(patsubst %,check-%, $(check-speed-y))
check-block: $(patsubst %,check-%, $(check-block-y))
check: check-qapi-schema check-unit check-qtest check-decodetree
check-clean:
- $(MAKE) -C tests/tcg clean
rm -rf $(check-unit-y) tests/*.o $(QEMU_IOTESTS_HELPERS-y)
rm -rf $(sort $(foreach target,$(SYSEMU_TARGET_LIST),
$(check-qtest-$(target)-y)) $(check-qtest-generic-y))
rm -f tests/test-qapi-gen-timestamp
diff --git a/tests/tcg/Makefile.include b/tests/tcg/Makefile.include
index cb8bb36026..67e89ecb67 100644
--- a/tests/tcg/Makefile.include
+++ b/tests/tcg/Makefile.include
@@ -8,19 +8,14 @@
# guest compiler or calling one of our docker images to do it for us.
#
-# The per ARCH makefile, if it exists holds extra information about
-# useful docker images or alternative compiler flags. Include it if it
-# exists
+# The per ARCH makefile, if it exists, holds extra information about
+# useful docker images or alternative compiler flags.
-ARCH_MAKEFILE=$(SRC_PATH)/tests/tcg/$(TARGET_NAME)/Makefile.include
-CHECK_INCLUDE=$(wildcard $(ARCH_MAKEFILE))
-
-ifeq ($(ARCH_MAKEFILE),$(CHECK_INCLUDE))
-include $(ARCH_MAKEFILE)
-endif
+-include $(SRC_PATH)/tests/tcg/$(TARGET_BASE_ARCH)/Makefile.include
+-include $(SRC_PATH)/tests/tcg/$(TARGET_NAME)/Makefile.include
GUEST_BUILD=
-
+TCG_MAKE=$(SRC_PATH)/tests/tcg/Makefile
# Support installed Cross Compilers
ifdef CROSS_CC_GUEST
@@ -28,10 +23,10 @@ ifdef CROSS_CC_GUEST
.PHONY: cross-build-guest-tests
cross-build-guest-tests:
$(call quiet-command, \
- (mkdir -p tests && cd tests && \
- make -f $(SRC_PATH)/tests/tcg/Makefile ARCH=$(TARGET_NAME)
CC=$(CROSS_CC_GUEST)), \
- "CROSS-BUILD","$(TARGET_NAME) guest-tests with $(CROSS_CC_GUEST)")
-
+ (mkdir -p tests && cd tests && \
+ make -f $(TCG_MAKE) CC=$(CROSS_CC_GUEST) \
+ EXTRA_CFLAGS=$(CROSS_CC_GUEST_CFLAGS)), \
+ "CROSS-BUILD","$(TARGET_NAME) guest-tests with $(CROSS_CC_GUEST)")
GUEST_BUILD=cross-build-guest-tests
@@ -54,9 +49,10 @@ DOCKER_PREREQ=docker-image-$(DOCKER_IMAGE)
.PHONY: docker-build-guest-tests
docker-build-guest-tests: $(DOCKER_PREREQ)
$(call quiet-command, \
- (mkdir -p tests && cd tests && \
- make -f $(SRC_PATH)/tests/tcg/Makefile ARCH=$(TARGET_NAME)
CC=$(DOCKER_COMPILE_CMD)), \
- "CROSS-BUILD","$(TARGET_NAME) guest-tests with docker
qemu:$(DOCKER_IMAGE)")
+ (mkdir -p tests && cd tests && \
+ make -f $(TCG_MAKE) CC=$(DOCKER_COMPILE_CMD) \
+ EXTRA_CFLAGS=$(DOCKER_CROSS_COMPILER_CFLAGS)), \
+ "CROSS-BUILD","$(TARGET_NAME) guest-tests with docker
qemu:$(DOCKER_IMAGE)")
GUEST_BUILD=docker-build-guest-tests
@@ -68,9 +64,20 @@ endif
ifneq ($(GUEST_BUILD),)
guest-tests: $(GUEST_BUILD)
+
+run-guest-tests: guest-tests
+ $(call quiet-command, \
+ (cd tests && make -f $(TCG_MAKE) run), \
+ "RUN-TESTS", "for $(TARGET_NAME)")
+
else
guest-tests:
- $(call quiet-command, /bin/true, "CROSS-BUILD", "$(TARGET_NAME)
guest-tests SKIPPED")
+ $(call quiet-command, /bin/true, "CROSS-BUILD", \
+ "$(TARGET_NAME) guest-tests SKIPPED")
+
+run-guest-tests:
+ $(call quiet-command, /bin/true, "RUN-TESTS", \
+ "for $(TARGET_NAME) SKIPPED")
endif
# It doesn't mater if these don't exits
--
2.17.0
- Re: [Qemu-devel] [PATCH v3 28/46] tests/tcg/aarch64: add Makefile.target, (continued)
- [Qemu-devel] [PATCH v3 35/46] tests/tcg: enable building for Alpha, Alex Bennée, 2018/04/24
- [Qemu-devel] [PATCH v3 46/46] tests/tcg: override runners for broken tests (!UPSTREAM), Alex Bennée, 2018/04/24
- [Qemu-devel] [PATCH v3 41/46] tests/tcg: enable building for sparc64, Alex Bennée, 2018/04/24
- [Qemu-devel] [PATCH v3 42/46] tests/tcg: enable building for mips64, Alex Bennée, 2018/04/24
- [Qemu-devel] [PATCH v3 45/46] tests/Makefile.include: add [build|clean|check]-tcg targets,
Alex Bennée <=
- Re: [Qemu-devel] [PATCH v3 45/46] tests/Makefile.include: add [build|clean|check]-tcg targets, Philippe Mathieu-Daudé, 2018/04/24
[Qemu-devel] [PATCH v3 19/46] tests/tcg/i386: Build fix for hello-i386, Alex Bennée, 2018/04/24
[Qemu-devel] [PATCH v3 25/46] tests/tcg/i386/test-i386: fix printf format, Alex Bennée, 2018/04/24
[Qemu-devel] [PATCH v3 15/46] tests/tcg/multiarch: move most output to stdout, Alex Bennée, 2018/04/24