From patchwork Fri Jun 14 17:11:52 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: 166860 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp2349146ilk; Fri, 14 Jun 2019 10:51:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqzu4alwcrYaRWMb7FvF2aom6viSQxOaU7i28ELlLrc0Axr8dzECM5mmDpt1RgaIT2INylaI X-Received: by 2002:ae9:c108:: with SMTP id z8mr16369149qki.57.1560534670699; Fri, 14 Jun 2019 10:51:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560534670; cv=none; d=google.com; s=arc-20160816; b=dzgsT/5yasBIUxrE4Xlue5JJnQaytdcLu8Aef7Et99koR/b6t0FgeAK/vuMRvZ2jwb uv+kjHN5DEigAiZvVxV2XTtcrYGRaxgzV07IBYNcI7oaxj4XdPxPAvNGcT/q2gcQ4Xwm dXTgGMO2xJK3ev5baAzo1u2CGIOCz0Ago0gSlhQmTO2Jv7Y/2wIi1NOgKsDHWCmGRh3l sNb6hio2CtcPKyyTs6Od2xl3A9jt1FCwYKWAVpmY3YvgW05TBDf+rHiyjzc/GO1R8xOf CZKaXggf5ksPOkcvuey+FNd+lpbft21rs8Ft55kkYXJ3n9q0a/Gtx8QsuzbQndMqx48m rYQw== 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=AtuxXjdv5rXrTnKR+kY966HW3wPcp99t7mVhH09mMeM=; b=YKqIfbO/WoCKMMnrcjDuWAGSn9MIfwok2yF0EoWh/QIzAlyV2ybuwsSIkRlmTGbDvb DRKS80M+TScljLY8f78pB+7HiFlTwpJXuHKoa0hPbMk/E8ARytSHFQ1JwFxBKy9hqGDr xkr+O9KNPjgqR5f+ySZRzeiGr8yn1BUN/vpJTQ9qH30utxlR2i3GGWKsxW052xeK3Ia2 GDwdQ4d7808VwqwRVwaD508Gy+tFDupcNEaBg47BX4qn0psqkXGnzDMdv1W/HDKZqGac jgCnQxdNAv9LBqhXrw+gQdXIfdOaYz8A5cRK73PU8yfckoveBGGVTQxKZSBK/+ACgobw 98ew== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Ucb28COx; 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 k129si2282746qkc.35.2019.06.14.10.51.10 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 14 Jun 2019 10:51:10 -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=Ucb28COx; 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]:53894 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hbqM2-0005k5-8s for patch@linaro.org; Fri, 14 Jun 2019 13:51:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58664) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hbpqj-0005bD-60 for qemu-devel@nongnu.org; Fri, 14 Jun 2019 13:18:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hbpqe-000790-U9 for qemu-devel@nongnu.org; Fri, 14 Jun 2019 13:18:47 -0400 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]:34591) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hbpqe-0006jT-9j for qemu-devel@nongnu.org; Fri, 14 Jun 2019 13:18:44 -0400 Received: by mail-wm1-x343.google.com with SMTP id w9so9349805wmd.1 for ; Fri, 14 Jun 2019 10:18:33 -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=AtuxXjdv5rXrTnKR+kY966HW3wPcp99t7mVhH09mMeM=; b=Ucb28COxP9N29+yMdbrQdA8kVqmAcU7/gxDxXTq8Wg5unXy7e46lTP2VZBMTDxPs25 TCC5DRkxaTJpGdp0YAf1P6n53sLM4VNTdU0BAEsHi05rG8aoGULBL+S3VYYwepmRG5Aw Kh3PRKN0UkQ1phFe8VQrLrSaflgWhiD1Bu/R3JhKzAlnP58osihn6EVYYs58MDJIhsKF UBYYPima3IZ5JT2av60y6NUDZGkDfd+bbGRaswGF+d5Y5QGUguJ9DW15LyUuC5q3LRpZ xdIzsA3gyClRJL9K0we/cnDS0hyCgzxqnbV5mY+/aYVj9ZTC/TS58jiZWDIsWCqSp0Bv DAXA== 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=AtuxXjdv5rXrTnKR+kY966HW3wPcp99t7mVhH09mMeM=; b=jKDb+CIRJ18NHkXcux4FM86iA0/aZWIPUPqjxUQIsHoHBM7D8nmdZ7yjFmLeQrNttf Y34rS7z0t9wW68DaKiQOh11Sq6FlSGtQjHwXA98mqBg92zTC1p3fjD6YqPnen4C1jR2Q CM5lnh3HkTeEwkrlAitDXCKDO0jofRtISPGlR4VMomRZSGHnjNpnZJe4b9z7GJ37jeuk R3n4LUH/1ELwDDEqe+FND0XJZWWcm401Gc9ME03CDvdUIdXbuD5oo6uxw6Swr3QSBu6e O6Wpotnsrgh0ExtpplJR1yTh9d5lPmfoqW7m1cB6E7v1kedWbzSHbANmX+Wy6Q3U+Tw5 re5Q== X-Gm-Message-State: APjAAAUuY9fWIrWgPfKxOb67g+g7RUp1+n01l0CPvMOQalGRdeqWzVAD RUPSqxFPE6UL6F0mWTTYdq/TFw== X-Received: by 2002:a7b:c94a:: with SMTP id i10mr8445078wml.97.1560532712975; Fri, 14 Jun 2019 10:18:32 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id x129sm5473118wmg.44.2019.06.14.10.18.28 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 14 Jun 2019 10:18:29 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 3B87D1FFC1; Fri, 14 Jun 2019 18:12:04 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Fri, 14 Jun 2019 18:11:52 +0100 Message-Id: <20190614171200.21078-43-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190614171200.21078-1-alex.bennee@linaro.org> References: <20190614171200.21078-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::343 Subject: [Qemu-devel] [PATCH v3 42/50] 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 , "open list:ARM TCG CPUs" , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= 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 db750dd6d0..04b0460262 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -1047,6 +1047,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)) @@ -1061,7 +1069,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 6fa63cc8d5..9474ab2900 100644 --- a/tests/tcg/Makefile +++ b/tests/tcg/Makefile @@ -116,11 +116,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, $<, \ @@ -128,6 +154,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 49d48d8a1c..cd628306b3 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