From patchwork Wed Jul 31 16:07:12 2019 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: 170184 Delivered-To: patch@linaro.org Received: by 2002:a92:512:0:0:0:0:0 with SMTP id q18csp4236163ile; Wed, 31 Jul 2019 09:29:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqy6sCDBJPxxepBNu/sI8Aull1n4293vfy6KlG8wS2n+j2IIwB/WY8UAJ/ryYMM/MaLIqF7M X-Received: by 2002:a50:996e:: with SMTP id l43mr109656454edb.187.1564590558850; Wed, 31 Jul 2019 09:29:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564590558; cv=none; d=google.com; s=arc-20160816; b=Acn8DzRmroRaHLosGhHy3Dc9xY6dBcPenHe28Qbu4g5INO18e6h5ph1GlqlrHq1WF6 KtgWnO/Uw3nZwOu6vp/gxTmisSe/NJhSTzX1y4CcXulh/v8UiArSuJ67kGUmUwNaPVoL 0grfBXd9mujA1ixbUyyuhQiPnb+DaqvmFFMTlNPjt6a2oKB+b5mjjMKk9vGkADHIj1kW vNFKbGZZ/pe21LuUtMUFDVpHPquWqN4Rhipo+8qClUbiDkW0TETNcsV5rnmk9GlIyqLJ 5nHDtC6Qqz7JLN01Jdcx8NyHc1J/4a0jJJiLqnLFWe+NCYFEJnwdbmxkDJ+JKI5rLdDx rIZw== 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; bh=JaUAcLe7WApBUvZggWzDrAHFeYLwHQ7XG4Fw2HOaxGw=; b=VDr3AB8auk2RdOAJBFigVcoTltfv0c9N8eZX9tDG5mP/2wmj2ctqSLgQYEQaSVYbbQ uJL0AzW4ViWZBSmXpbH8D7SHTffBE/Wkjr5XBKipotW57OfYwuZVCSYn68zInSkVwLOQ 8+UiNBpnaFyJqtw8McJ3x9Q+k2bl5ziuPNBc8uPS9rurFybCZNIrFd20EdUEunuv/nB9 dcIkVFQmDNzluKtl1bkoBy9KU980zYgvAC3mB0GCQz4u/IBF2ObcgMTdxfs7Kr8EV834 wmm2SkS2IvrytpjhU9AbZwCg62YgIs7jgTMu1pOmI4bfWQ7/63eEqa4/72DjPfRYTh3k 5g9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=RSFIrqYE; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 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. [209.51.188.17]) by mx.google.com with ESMTPS id v25si18747044eja.29.2019.07.31.09.29.18 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 31 Jul 2019 09:29:18 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=RSFIrqYE; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 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]:42780 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hsrTZ-0006tI-S0 for patch@linaro.org; Wed, 31 Jul 2019 12:29:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45126) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hsrPj-0004qk-RA for qemu-devel@nongnu.org; Wed, 31 Jul 2019 12:25:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hsrPi-0000JV-GJ for qemu-devel@nongnu.org; Wed, 31 Jul 2019 12:25:19 -0400 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:42667) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hsrPi-0000HN-78 for qemu-devel@nongnu.org; Wed, 31 Jul 2019 12:25:18 -0400 Received: by mail-wr1-x441.google.com with SMTP id x1so20467924wrr.9 for ; Wed, 31 Jul 2019 09:25:18 -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=JaUAcLe7WApBUvZggWzDrAHFeYLwHQ7XG4Fw2HOaxGw=; b=RSFIrqYEdE0/yJtJEOEytzg/HWvurEB5+6/0P4Y7M8RjoE3E19CgVLQ2nHgxHF50Oa Yo8s9TAN5BYiLAAzdx1Yvsx5J7WrTNv6Hq7xsztPBX6cx3gAgMYFsQ1++CanGF52bQQJ FmM2Sp3YvcjsAlqJt6F5iMSSAf6/K+JbYiH7iSYnmwrSAu2TXyAZqCt8CLh33s/lnkNn IZ3rAofmjv2nga/Wh3IirCS9TMvvsH1VHOFQG1ZnXTYr2q3443rwLboWgft2eoUaSkZE 3+B3Ah8cvE65Wxfs5NReXi+OyfgJItAIabF9puSzA4YcHIw2BWI2MpTQBZX3kq04Q5u/ v0zA== 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=JaUAcLe7WApBUvZggWzDrAHFeYLwHQ7XG4Fw2HOaxGw=; b=lQ9oYW8XFCvtz0rFI7d9DT+Yc+TtLwLeJA2TXHIMvInzAlCzHPbiO1OYCNyU4D3AtS BHp9ILEMQP845X+ySaCla6pFqW1rKMrkc+/ANopSkHnnLymKAEr7ZU960NkeAWoZKgHO 2slSODEPQEYENgTAabCkMIEvspHlUVrlykm3xO1ZqMXvR3B1Ro7NTuV8AJrPbdsw9dXg OedPQFlfDc6i1CtPbnFdHBy/VtEUi0tEyhFvnikdYIzE5aw9P5sRctmWMxYe17O+wqVp /avkyCEcfBpu0RsltrZWgj3rZfQqZbHm6mz0nzQQ8UxXq6LSsSRHaeTnvsiIHaoL+DlQ ncSA== X-Gm-Message-State: APjAAAUDOHRkDOf212Iyv6P+pyNdvlQflP2FsZHoEIiT1vdot+IJyfAN DPTDYO7+04j1/qGp+sSVFKWMyg== X-Received: by 2002:adf:f6d2:: with SMTP id y18mr59384191wrp.102.1564590316038; Wed, 31 Jul 2019 09:25:16 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id d10sm57418559wrx.34.2019.07.31.09.25.12 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 31 Jul 2019 09:25:13 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id D022B1FFC5; Wed, 31 Jul 2019 17:07:23 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Wed, 31 Jul 2019 17:07:12 +0100 Message-Id: <20190731160719.11396-48-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190731160719.11396-1-alex.bennee@linaro.org> References: <20190731160719.11396-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:4864:20::441 Subject: [Qemu-devel] [PATCH v4 47/54] tests/tcg: enable plugin testing X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , =?utf-8?q?Philippe_Mathieu-D?= =?utf-8?b?YXVkw6k=?= , aaron@os.amperecomputing.com, cota@braap.org, "open list:ARM TCG CPUs" , bobby.prani@gmail.com, =?utf-8?q?Alex_Benn?= =?utf-8?b?w6ll?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" If CONFIG_PLUGINS is enabled then lets enable testing for all our TCG targets. This is a simple smoke test that ensure we don't crash or otherwise barf out by running each plugin against each test. There is a minor knock on effect for additional runners which need specialised QEMU_OPTS which will also need to declare a plugin version of the runner. If this gets onerous we might need to add another helper. Checking the results of the plugins is left for a later exercise. Signed-off-by: Alex Bennée --- tests/Makefile.include | 10 +++++++- tests/tcg/Makefile | 34 +++++++++++++++++++++++++++ tests/tcg/arm/Makefile.softmmu-target | 1 + 3 files changed, 44 insertions(+), 1 deletion(-) -- 2.20.1 diff --git a/tests/Makefile.include b/tests/Makefile.include index fd7fdb86586..0611aede077 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -1052,6 +1052,14 @@ check-softfloat: "SKIPPED for non-TCG builds") endif +# Plugins +ifeq ($(CONFIG_PLUGIN),y) +plugins: + $(call quiet-command,\ + $(MAKE) $(SUBDIR_MAKEFLAGS) -C tests/plugin V="$(V)", \ + "BUILD", "plugins") +endif + # Per guest TCG tests BUILD_TCG_TARGET_RULES=$(patsubst %,build-tcg-tests-%, $(TARGET_DIRS)) @@ -1066,7 +1074,7 @@ $(foreach PROBE_TARGET,$(TARGET_DIRS), \ $(eval build-tcg-tests-$(PROBE_TARGET): $(DOCKER_PREREQ)))) endif -build-tcg-tests-%: +build-tcg-tests-%: $(if $(CONFIG_PLUGIN),plugins) $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $* V="$(V)" \ SKIP_DOCKER_BUILD=1 TARGET_DIR="$*/" guest-tests, \ "BUILD", "TCG tests for $*") diff --git a/tests/tcg/Makefile b/tests/tcg/Makefile index 9f567686240..8341a5345bc 100644 --- a/tests/tcg/Makefile +++ b/tests/tcg/Makefile @@ -120,11 +120,37 @@ all: $(TESTS) # RUN_TESTS=$(patsubst %,run-%, $(TESTS)) + +# If plugins exist also include those in the tests +ifeq ($(CONFIG_PLUGIN),y) +PLUGIN_DIR=../../tests/plugin +VPATH+=$(PLUGIN_DIR) +PLUGINS=$(notdir $(wildcard $(PLUGIN_DIR)/*.so)) + +# We need to ensure expand the run-plugin-TEST-with-PLUGIN +# pre-requistes manually here as we can't use stems to handle it. We +# also add some special helpers the run-plugin- rules can use bellow. + +$(foreach p,$(PLUGINS), \ + $(foreach t,$(TESTS),\ + $(eval run-plugin-$(t)-with-$(p): $t $p) \ + $(eval RUN_TESTS+=run-plugin-$(t)-with-$(p)))) +endif + +strip-plugin = $(wordlist 1, 1, $(subst -with-, ,$1)) +extract-plugin = $(wordlist 2, 2, $(subst -with-, ,$1)) + RUN_TESTS+=$(EXTRA_RUNS) ifdef CONFIG_USER_ONLY run-%: % $(call run-test, $<, $(QEMU) $(QEMU_OPTS) $<, "$< on $(TARGET_NAME)") + +run-plugin-%: + $(call run-test, $@, $(QEMU) $(QEMU_OPTS) \ + -plugin $(PLUGIN_DIR)/$(call extract-plugin,$@) \ + $(call strip-plugin,$<), \ + "$< on $(TARGET_NAME)") else run-%: % $(call run-test, $<, \ @@ -132,6 +158,14 @@ run-%: % -chardev file$(COMMA)path=$<.out$(COMMA)id=output \ $(QEMU_OPTS) $<, \ "$< on $(TARGET_NAME)") + +run-plugin-%: + $(call run-test, $@, \ + $(QEMU) -monitor none -display none \ + -chardev file$(COMMA)path=$@.out$(COMMA)id=output \ + -plugin $(PLUGIN_DIR)/$(call extract-plugin,$@) \ + $(QEMU_OPTS) $(call strip-plugin,$<), \ + "$< on $(TARGET_NAME)") endif gdb-%: % diff --git a/tests/tcg/arm/Makefile.softmmu-target b/tests/tcg/arm/Makefile.softmmu-target index 49d48d8a1c3..cd628306b3e 100644 --- a/tests/tcg/arm/Makefile.softmmu-target +++ b/tests/tcg/arm/Makefile.softmmu-target @@ -25,5 +25,6 @@ LDFLAGS+=-nostdlib -N -static test-armv6m-undef: EXTRA_CFLAGS+=-mcpu=cortex-m0 run-test-armv6m-undef: QEMU_OPTS+=-semihosting -M microbit -kernel +run-plugin-test-armv6m-undef-%: QEMU_OPTS+=-semihosting -M microbit -kernel endif