From nobody Sat Nov 15 07:41:34 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1754007525; cv=none; d=zohomail.com; s=zohoarc; b=ZytKiOI/yTN7eY0WYXeNhJCXCjkVWQFUXX2rHwvFEjeVQPpUY/hxAl24Er2crTKpv3gbvime2UagXwnm24w4Nh8BkFkztCEYBZkeqTTkPN2mO4zG479aPFzImiJGqHVC24I9pGQQdAriP/BbiQqTu7+3BA/wgORdof/ZDiv1Dws= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1754007525; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=puyOmxGd5nbAUKxa4bS/YO3K65xgCmHZUgpZjwuLvOY=; b=hhrxHQmyFLvMmAYr77UU6857w352yVXFgT8phtQRrwZK6ut2JjES+j6ym8vOlSfSmOFLuox45NUazLZ8jeQCmja0++KyOu5AVTCFXl2MLjsSZkVxmspEILHMg5amd064ptbqaMCA/31ggOuQj+0m64UmDzXsGhPjigj8EeaGK+8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1754007525215914.9683088467864; Thu, 31 Jul 2025 17:18:45 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uhdTJ-000334-MK; Thu, 31 Jul 2025 20:18:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uhdOu-0007xw-HV for qemu-devel@nongnu.org; Thu, 31 Jul 2025 20:13:32 -0400 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uhdOq-0001kD-PS for qemu-devel@nongnu.org; Thu, 31 Jul 2025 20:13:32 -0400 Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-240763b322fso10438335ad.0 for ; Thu, 31 Jul 2025 17:13:20 -0700 (PDT) Received: from gromero0.. ([152.243.37.35]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-241d1f1ebc1sm27993855ad.67.2025.07.31.17.13.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Jul 2025 17:13:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1754007199; x=1754611999; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=puyOmxGd5nbAUKxa4bS/YO3K65xgCmHZUgpZjwuLvOY=; b=YhGxl2qN3KE4VJ02gClvVaKXei4CnfGlaVNm1hQo7yVkAUVdaGqel0PtqlpsZQLqwY bSABEYcIqYfQPDlsMqmY/dnE2HYA5XJ5B3PRA5/MVbaoVwkMmHiEsuq+HuqVokwUT7jp zFfHQAtWqR3P0Pxmz/LsgO66k/sNQF1SeB17FjFSfkx0eftRYiRgX0PN9a2ZvTpzXTW+ NbRxDsGKsEb8qT+ZH+4I0OO6YPa/lIhR1w2ttvfvw8UpNGmOlwBf7nfE8/qNk1XSgmcs u+M2txjs24fpgYn8sypG07VXG9bQahpNX24qih/YlCm/gawZpQbkU5/47nozHeE99eQj 3V3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754007199; x=1754611999; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=puyOmxGd5nbAUKxa4bS/YO3K65xgCmHZUgpZjwuLvOY=; b=xDfbEGewJyrZ8HMtrGdOCMIvafxf7CSas0/KXCvDw1AGXnhJyUHLYGxY05aWePARqY CvzT6o87OhZQeauqH9Koi9+tDLsjKpxUD5oza0OWcuYHaMl2khP6C+yLAWG7u+5zSYSK 0lAaKC9JFN63akKF0Cb08zfxossoq+x/PVaiAHt25VVBStmKGFQlilVLW3gc+D4AU5Da IisM1nNwjpbwdE5W+QWBSVjs2pkHZW90fXb+NzN3P4ojXZTMi+xds59rTyW4D05HzkQw 5sTEiVOLCe7ZpuV4CkVglnu8HF3JKbaMqFyai4xR+C7CnRhxIYHo15k0hczxGSVu2bDe uA8A== X-Gm-Message-State: AOJu0YyQJBkkEN9EUEf9fuSAVSO3CxHYJoWm5rp/CRXdkCX7iD36k+ZW 7BZeya+Q4DcYufu2AbVKaWe4xOJlV4eZZwsvEBrfOjc4HpaSmx25nZKjCewIr3MADGlOMRPPc4V MUdfCRG4= X-Gm-Gg: ASbGncuCRld/1NnozSfQwVPCVzKc49aj6xwiQcG08julvwpV5LZYnsb94+vWMwQtpbA dHI+pEUcrdODPt46o/qpwyE57+ZhOleyyZip0tOl2D53qeJvn20UXT/akXBTOJp0lLrEZ0iTTFY mnn/3n0n49L413/3ApqM9uslCZ9ICN/lb9Y14Vy3yTi/3DMkIft5Vx2A/IG0KtPOsKg/zSFhvKf IWaVvaRklrr+x97u543LbgqaW9LdEGWVz9u2dLUZrWJZVMEEYwY7KYklVmr+2lQCjyiaBgF4t8t 4x6qqeC47zg77xg1sAf0QjQ1UDk2YrKUE9aLr752uEm0lrTVFOtfOeqpMPqiOu3UT7zP0BViTdh yYrl378mhIxXWZzKTS+TT7oIzDhY= X-Google-Smtp-Source: AGHT+IGHF62TxgPqvJmlTwcX9rGAZqDUXXtOfDQVWBm5/qeGiVStZKpeuhzZVncIUgF6kXTqVk7hqQ== X-Received: by 2002:a17:903:1b6d:b0:240:8fee:e500 with SMTP id d9443c01a7336-24096b76dffmr122340575ad.50.1754007199035; Thu, 31 Jul 2025 17:13:19 -0700 (PDT) From: Gustavo Romero To: qemu-devel@nongnu.org, alex.bennee@linaro.org, pierrick.bouvier@linaro.org, manos.pitsidianakis@linaro.org Cc: qemu-arm@nongnu.org, gustavo.romero@linaro.org Subject: [PATCH v2] tests/tcg: Fix run for tests with specific plugin Date: Fri, 1 Aug 2025 00:13:05 +0000 Message-Id: <20250801001305.2352554-1-gustavo.romero@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::62c; envelope-from=gustavo.romero@linaro.org; helo=mail-pl1-x62c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1754007526216116600 Commit 25aaf0cb7f (=E2=80=9Ctests/tcg: reduce the number of plugin test combinations=E2=80=9D) added support for running tests with specific plugins passed via the EXTRA_RUNS variable. However, due to the optimization, the rules generated as a shuffled combination of tests and plugins might not cover the rules required to run the tests with a specific plugin passed via EXTRA_RUNS. This commit fixes it by correctly generating the rules for the tests that require a specific plugin to run, which are now passed via the EXTRA_RUNS_WITH_PLUGIN instead of via the EXTRA_RUNS variable. The fix essentially excludes the tests passed via EXTRA_RUNS_WITH_PLUGIN from the rules created by the shuffled combination of tests and plugins, to avoid running the tests twice, and generates the rules for the test/plugin combinations listed in the EXTRA_RUNS_WITH_PLUGIN variable. Signed-off-by: Gustavo Romero Reviewed-by: Pierrick Bouvier Tested-by: Pierrick Bouvier --- tests/tcg/Makefile.target | 20 ++++++++++++++++--- tests/tcg/multiarch/Makefile.target | 2 +- .../multiarch/system/Makefile.softmmu-target | 2 +- tests/tcg/x86_64/Makefile.softmmu-target | 2 +- 4 files changed, 20 insertions(+), 6 deletions(-) diff --git a/tests/tcg/Makefile.target b/tests/tcg/Makefile.target index 18afd5be19..af72903f89 100644 --- a/tests/tcg/Makefile.target +++ b/tests/tcg/Makefile.target @@ -170,6 +170,10 @@ endif PLUGINS=3D$(filter-out $(DISABLE_PLUGINS), \ $(patsubst %.c, lib%.so, $(notdir $(wildcard $(PLUGIN_SRC)/*.c)))) =20 +strip-plugin =3D $(wordlist 1, 1, $(subst -with-, ,$1)) +extract-plugin =3D $(wordlist 2, 2, $(subst -with-, ,$1)) +extract-test =3D $(subst run-plugin-,,$(wordlist 1, 1, $(subst -with-, ,$1= ))) + # 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 # only expand MULTIARCH_TESTS which are common on most of our targets @@ -179,6 +183,13 @@ PLUGINS=3D$(filter-out $(DISABLE_PLUGINS), \ =20 ifneq ($(MULTIARCH_TESTS),) =20 +# Extract extra tests from the extra test+plugin combination. +EXTRA_TESTS_WITH_PLUGIN=3D$(foreach test, \ + $(EXTRA_RUNS_WITH_PLUGIN),$(call extract-test,$(te= st))) +# Exclude tests that were specified to run with specific plugins from the = tests +# which can run with any plugin combination, so we don't run it twice. +MULTIARCH_TESTS:=3D$(filter-out $(EXTRA_TESTS_WITH_PLUGIN), $(MULTIARCH_TE= STS)) + NUM_PLUGINS :=3D $(words $(PLUGINS)) NUM_TESTS :=3D $(words $(MULTIARCH_TESTS)) =20 @@ -186,19 +197,22 @@ define mod_plus_one $(shell $(PYTHON) -c "print( ($(1) % $(2)) + 1 )") endef =20 +# Rules for running tests with any plugin combination, i.e., no specific p= lugin. $(foreach _idx, $(shell seq 1 $(NUM_TESTS)), \ $(eval _test :=3D $(word $(_idx), $(MULTIARCH_TESTS))) \ $(eval _plugin :=3D $(word $(call mod_plus_one, $(_idx), $(NUM_PLUGINS)),= $(PLUGINS))) \ $(eval run-plugin-$(_test)-with-$(_plugin): $(_test) $(_plugin)) \ $(eval RUN_TESTS+=3Drun-plugin-$(_test)-with-$(_plugin))) =20 +# Rules for running extra tests with specific plugins. +$(foreach f,$(EXTRA_RUNS_WITH_PLUGIN), \ + $(eval $(f): $(call extract-test,$(f)) $(call extract-plugin,$(f)))) + endif # MULTIARCH_TESTS endif # CONFIG_PLUGIN =20 -strip-plugin =3D $(wordlist 1, 1, $(subst -with-, ,$1)) -extract-plugin =3D $(wordlist 2, 2, $(subst -with-, ,$1)) - RUN_TESTS+=3D$(EXTRA_RUNS) +RUN_TESTS+=3D$(EXTRA_RUNS_WITH_PLUGIN) =20 # Some plugins need additional arguments above the default to fully # exercise things. We can define them on a per-test basis here. diff --git a/tests/tcg/multiarch/Makefile.target b/tests/tcg/multiarch/Make= file.target index 38345ff880..8dc65d7a06 100644 --- a/tests/tcg/multiarch/Makefile.target +++ b/tests/tcg/multiarch/Makefile.target @@ -201,7 +201,7 @@ run-plugin-test-plugin-mem-access-with-libmem.so: \ $(SRC_PATH)/tests/tcg/multiarch/check-plugin-output.sh \ $(QEMU) $< =20 -EXTRA_RUNS +=3D run-plugin-test-plugin-mem-access-with-libmem.so +EXTRA_RUNS_WITH_PLUGIN +=3D run-plugin-test-plugin-mem-access-with-libmem.= so endif =20 # Update TESTS diff --git a/tests/tcg/multiarch/system/Makefile.softmmu-target b/tests/tcg= /multiarch/system/Makefile.softmmu-target index 4171b4e6aa..98c4eda5e0 100644 --- a/tests/tcg/multiarch/system/Makefile.softmmu-target +++ b/tests/tcg/multiarch/system/Makefile.softmmu-target @@ -77,5 +77,5 @@ run-plugin-memory-with-libmem.so: memory libmem.so run-plugin-memory-with-libmem.so: PLUGIN_ARGS=3D$(COMMA)region-summary=3Dt= rue run-plugin-memory-with-libmem.so: CHECK_PLUGIN_OUTPUT_COMMAND=3D$(MULTIARC= H_SYSTEM_SRC)/validate-memory-counts.py $@.out =20 -EXTRA_RUNS +=3D run-plugin-memory-with-libmem.so +EXTRA_RUNS_WITH_PLUGIN +=3D run-plugin-memory-with-libmem.so endif diff --git a/tests/tcg/x86_64/Makefile.softmmu-target b/tests/tcg/x86_64/Ma= kefile.softmmu-target index 3e30ca9307..4e65f58b57 100644 --- a/tests/tcg/x86_64/Makefile.softmmu-target +++ b/tests/tcg/x86_64/Makefile.softmmu-target @@ -40,5 +40,5 @@ run-plugin-patch-target-with-libpatch.so: \ run-plugin-patch-target-with-libpatch.so: \ CHECK_PLUGIN_OUTPUT_COMMAND=3D$(X64_SYSTEM_SRC)/validate-patch.py $@.out run-plugin-patch-target-with-libpatch.so: patch-target libpatch.so -EXTRA_RUNS+=3Drun-plugin-patch-target-with-libpatch.so +EXTRA_RUNS_WITH_PLUGIN+=3Drun-plugin-patch-target-with-libpatch.so endif --=20 2.34.1