From patchwork Fri Nov 25 22:05:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 9448151 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D7D176071C for ; Fri, 25 Nov 2016 22:11:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C7BDC27B2F for ; Fri, 25 Nov 2016 22:11:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BC9DD280CF; Fri, 25 Nov 2016 22:11:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 65E0727B2F for ; Fri, 25 Nov 2016 22:11:12 +0000 (UTC) Received: from localhost ([::1]:48103 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cAOi7-0001VF-BM for patchwork-qemu-devel@patchwork.kernel.org; Fri, 25 Nov 2016 17:11:11 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50537) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cAOdP-0006Mg-UQ for qemu-devel@nongnu.org; Fri, 25 Nov 2016 17:06:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cAOdO-0008HG-QK for qemu-devel@nongnu.org; Fri, 25 Nov 2016 17:06:19 -0500 Received: from mx1.redhat.com ([209.132.183.28]:35998) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cAOdO-0008GH-Hz for qemu-devel@nongnu.org; Fri, 25 Nov 2016 17:06:18 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A3F6737E62 for ; Fri, 25 Nov 2016 22:06:17 +0000 (UTC) Received: from localhost (ovpn-116-207.phx2.redhat.com [10.3.116.207]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id uAPM6GJu016221; Fri, 25 Nov 2016 17:06:17 -0500 From: Eduardo Habkost To: qemu-devel@nongnu.org, Markus Armbruster , Marcel Apfelbaum , "Michael S. Tsirkin" Date: Fri, 25 Nov 2016 20:05:41 -0200 Message-Id: <1480111556-32586-6-git-send-email-ehabkost@redhat.com> In-Reply-To: <1480111556-32586-1-git-send-email-ehabkost@redhat.com> References: <1480111556-32586-1-git-send-email-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Fri, 25 Nov 2016 22:06:17 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [RFC v2 05/20] tests: Add rules to non-gtester qtest test cases 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: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 --- Changes v1 -> v2: * Change "define qtest-target =" to "define qtest-target" to make older versions of GNU Make happy * Print QTEST- 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