From patchwork Tue Jan 17 01:02:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 715987 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3v2XGH1prgz9t0G for ; Tue, 17 Jan 2017 12:15:17 +1100 (AEDT) Received: from localhost ([::1]:60698 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cTIMj-00054p-H4 for incoming@patchwork.ozlabs.org; Mon, 16 Jan 2017 20:15:13 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36901) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cTIAS-0004y3-Ig for qemu-devel@nongnu.org; Mon, 16 Jan 2017 20:02:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cTIAR-0001nh-PD for qemu-devel@nongnu.org; Mon, 16 Jan 2017 20:02:32 -0500 Received: from mx1.redhat.com ([209.132.183.28]:47780) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cTIAR-0001lh-Hb for qemu-devel@nongnu.org; Mon, 16 Jan 2017 20:02:31 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (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 A967931B308 for ; Tue, 17 Jan 2017 01:02:31 +0000 (UTC) Received: from localhost (ovpn-116-2.gru2.redhat.com [10.97.116.2]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v0H12UJQ000716; Mon, 16 Jan 2017 20:02:31 -0500 From: Eduardo Habkost To: qemu-devel@nongnu.org Date: Mon, 16 Jan 2017 23:02:03 -0200 Message-Id: <20170117010204.4909-9-ehabkost@redhat.com> In-Reply-To: <20170117010204.4909-1-ehabkost@redhat.com> References: <20170117010204.4909-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 17 Jan 2017 01:02:31 +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] [PATCH 8/9] 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 --- Patch originally submitted as part of series: * [RFC v2 00/20] qmp: Report bus information on 'query-machines' --- tests/Makefile.include | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/tests/Makefile.include b/tests/Makefile.include index 202901374c..d9809c6229 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -795,6 +795,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) @@ -822,7 +856,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