From patchwork Tue Apr 24 15:24:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 134130 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp2409727lji; Tue, 24 Apr 2018 09:00:09 -0700 (PDT) X-Google-Smtp-Source: AIpwx48kxVXliGwKWcERCHANf0Kh4Uq5d1hZOhirzFiBWwzp9EnHAYIk4kPstO6rlZSIoGMt1XBs X-Received: by 2002:ac8:1e83:: with SMTP id c3-v6mr29504806qtm.410.1524585609337; Tue, 24 Apr 2018 09:00:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524585609; cv=none; d=google.com; s=arc-20160816; b=XDc+ZVJH/LKNZ9JPPgmmcsSFHBIA+W8K9mkBI3ybpvT/BuC6T0AKw8EwXNB+YLsMkW itf5z887fH/29L8GixY27e3ixU10zgR7CKzkG9Axxdox69GysTfCZ7Jopf2OOKThEqrt Z56vrxBcG3UoVyA0ygLykQONPhb2ERKT0Cv8SP3C/t6xbezXLB0wYYvlvbf86s8BbEuB 5eIziELox1BsXVsvfeBx7zhRkgVO+hrvODHESD5YzGO8CmwoUfQkwW+nmGM9/YOKAJEk mMTAv2ozXZNOjJ/WgWUUYwIwMJKEg97n1oCAifncHID3pZYYRA9fwf6W4XTpvNW9954g tKJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=jy+H1q0HHs7pa8fbMkJC45FeCYR1rX9VAPVX3Kc1s+o=; b=sWZxST5uNANT0B6N+GI+mb7djHmHDx/h3lPi4nMaZKZoPs5eYIzudCy9E09WOHumzP HVff6NqgoEarRHsSVAWNY3coHDXOUGN2pQsS+ql24cNmsGREXoEf0/HYWB9X7QNVYVOr ohmAbjxlNPxWHFbq3SlVe6N0OKHlNtNwa7q55ZQ7FkxILl5iIHoiGPYFEZ0xkbPrSIwC t5mp1HmdEyzRXJskdrqRkanlnGUpIe1Ylwq0ptHMwa1rVVbSaWSVVXDPx23LX2vJqEtg McEletcoE4ulx/F3Y7T/MtoS8ISw2Hm9Ih6OolE1KJ6IbR5eyNaAD1mGf4y9Z+U85xcl b9gg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=I6SYklXb; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id 6si4093117qku.370.2018.04.24.09.00.09 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 24 Apr 2018 09:00:09 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=I6SYklXb; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:59290 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fB0MS-0001Gd-OG for patch@linaro.org; Tue, 24 Apr 2018 12:00:08 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50414) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fAzwW-00060L-83 for qemu-devel@nongnu.org; Tue, 24 Apr 2018 11:33:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fAzwQ-0001Po-Tw for qemu-devel@nongnu.org; Tue, 24 Apr 2018 11:33:20 -0400 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]:38322) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fAzwQ-0001Oa-Ix for qemu-devel@nongnu.org; Tue, 24 Apr 2018 11:33:14 -0400 Received: by mail-wm0-x241.google.com with SMTP id i3so1602402wmf.3 for ; Tue, 24 Apr 2018 08:33:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jy+H1q0HHs7pa8fbMkJC45FeCYR1rX9VAPVX3Kc1s+o=; b=I6SYklXbzg2Vozh5O0b1dOyidw2I9mi26vp/eMZECMunzDdxB/4XCFfODBLqZ0SR2Y RjIX0Mc6qu6jCodHnFnQB7/FDWf6Gd4onxxrwao0cWjWhYhoyKV6XLVZO9kRVYYlqFok 5EmNGOvGgGkL2ZpUj+5oDj6KJf9A8K12byQPs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=jy+H1q0HHs7pa8fbMkJC45FeCYR1rX9VAPVX3Kc1s+o=; b=UG023xc6KoKcrGVWUC8sgoyT0sMg7qQUWKVTKvN60wgbcIzeQCn7sDk9+YnjCke8e+ Fim5fpt0PqL1ntU8Z/fMCaDmKvm6hm+RUXl3P7xggAFJmjsRNK72ibTh7e5l88n/97z+ fZP81CFswDo7R6IDz/0fUJcvJasCPhjS2qz+2Fu9g4ESKkBadIQnwsEz5sctFOaNaKI2 Z5EXBe5t/RWzrUnOZg08yzNZBPBnv6/aQzzwI56bMtrJyQn2EbX2vsKX3CF5VpIHUIMT 8EUYwWhAMubKTzvIuWj4dHKtiI3GGTuYVdMmcnNar1jso2N0VNC8s6rxbINvXrt8Q7pj hn+g== X-Gm-Message-State: ALQs6tCkwaU3khBI1CSxSvfz+VETjA/dQLrk1uA20kwbyGPgwHu1ISLP 1WNEkcFXfJXPrWPjjRHbUGQPaw== X-Received: by 10.28.66.148 with SMTP id k20mr1563909wmi.7.1524583993447; Tue, 24 Apr 2018 08:33:13 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id 78sm13513901wmm.19.2018.04.24.08.33.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Apr 2018 08:33:10 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 049CF3E1833; Tue, 24 Apr 2018 16:24:09 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org, cota@braap.org, famz@redhat.com, berrange@redhat.com, f4bug@amsat.org, richard.henderson@linaro.org, balrogg@gmail.com, aurelien@aurel32.net, agraf@suse.de Date: Tue, 24 Apr 2018 16:24:04 +0100 Message-Id: <20180424152405.10304-46-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180424152405.10304-1-alex.bennee@linaro.org> References: <20180424152405.10304-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::241 Subject: [Qemu-devel] [PATCH v3 45/46] tests/Makefile.include: add [build|clean|check]-tcg targets X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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 Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé --- 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(-) -- 2.17.0 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