From nobody Thu Nov 20 14:09:54 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1763461831; cv=none; d=zohomail.com; s=zohoarc; b=ORT16QCYDA//im7+X5oIVmK3J7HgRsx5sCm0QAw2IgbOlETNAY6yzqLZP+nkeb0mH8ErllmmwsisdGfb2RyJZw+kyR/mBL0g4xBJmkzFBsGqkHE4ofQgkzZ1ynVf5Ls2ZjaWgOfrxlFavNFbbM3dV18janOxz5Q6E7R52LW9kas= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1763461831; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=bFbOc8EhCAx8sad0roTMTN9jJAmTdHbS1Y6Z0xIpBBQ=; b=L9LMA6cO8kUcP2sOtvDzx4X4h9whvOrJnpL4ugDyapiNb59ezUHZjjynkUg1fGZwIetLhrAgJaGcPYCipsw3TMvjqBZO3glQDae18yJR1z2mT8tQtU0j94CBsVNG4jplMK/Q38Wg0qOfaV40O7yNoi9oXdZqP7oa+OzdhTvvsGU= 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1763461831932122.37615064528836; Tue, 18 Nov 2025 02:30:31 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vLIyC-0006U9-If; Tue, 18 Nov 2025 05:29:56 -0500 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 1vLIy9-0006TZ-OK for qemu-devel@nongnu.org; Tue, 18 Nov 2025 05:29:53 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vLIy8-00031U-0p for qemu-devel@nongnu.org; Tue, 18 Nov 2025 05:29:53 -0500 Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-321-PguL-nNeNoe6JESt6iLhBg-1; Tue, 18 Nov 2025 05:29:50 -0500 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-42b3086a055so3531709f8f.3 for ; Tue, 18 Nov 2025 02:29:49 -0800 (PST) Received: from [192.168.10.48] ([176.206.119.13]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-42b53e7b12asm31198140f8f.10.2025.11.18.02.29.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Nov 2025 02:29:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1763461791; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bFbOc8EhCAx8sad0roTMTN9jJAmTdHbS1Y6Z0xIpBBQ=; b=iMX/gupfOaQYbeiatXQX/t7yjO2l4A8P0noFrBb7lYCsTjzHBhuRrHpae1gqHqtATPpNfW nR9SnOLotLBdEMkOPjSP9xpVK8rBDvotXI7SI1FoLOvR4ZMDwMLWLTxGdxlLJ0B1eYK5Qt ZcZf+QT9ytQmoDTkai+IYhV26CTESVM= X-MC-Unique: PguL-nNeNoe6JESt6iLhBg-1 X-Mimecast-MFC-AGG-ID: PguL-nNeNoe6JESt6iLhBg_1763461789 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1763461788; x=1764066588; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=bFbOc8EhCAx8sad0roTMTN9jJAmTdHbS1Y6Z0xIpBBQ=; b=a++wBfOSyw3YjoPeaWept3AYpv6G6JTjJ8cz1btJc82sgZMsJPKKX/xZ7nhwEj3qCK GhCHzQk6a3j4cBcB31Eh4SF6QOtE0llNEQZWkUwN/lXc001zy82GBTqEy2+a2nOVgaEP 7KMEkoB0AFQXUoiVDP29bpGg9cVRB1LnJl4fcGmb5wjR5mJOnUdRjxGAl8RVOtnM4uVy LHrtWTBvuduribcGhR95ct8u6TeHe/Cj7yA6xrOyaUGixDXkDo/OUlFoFHgh5xvOctCO 2IOXLjD3AEryLxegmBVpVGw+AR9ySvRWQcKutY8ne4I/ja6TtPVJ+lmG0+uTkEsaiY2E YlFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763461788; x=1764066588; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=bFbOc8EhCAx8sad0roTMTN9jJAmTdHbS1Y6Z0xIpBBQ=; b=pHksfz4gqJr4hAkMByWQAjWsM31WzDBSOFdgtvgfUMfRzL/AZfVtl+ttojrhrJRPCa 34QTPbEVSxRVOI/EI5FFn7CFxnMVTG/+kvzGSZFxOdESS57CCB3smd9hFrG/SwWo2tuy ZgwJwuavdN2rtsiVdRAXA1jWjjbkHVjlNakfDUVSj+RaMJee/uzdIS831PfDgfshONO+ aV/VL8eAPNoSELPLWac8z7Enri93rAYofkrpbRUshupz1WoPCv97nmQ8sv+yFAqka4Dg 8VYtIQHkRbc+BUv7BOJjv4rJcaveY7+8PDS0cdn68XyyBenvrOpECALUY+iix0SRSrY8 CU7g== X-Gm-Message-State: AOJu0Yxe82zhbxEmsYYB97qYItUhOLQZ8jcbkOYlim52wPj/BKLXco6o dMMWsBRqkX5lHnluSS26QrEjph5rZ5oyMz93nIAHEo1bHZ+mFA9wFgimelJepS5Ynqf43l9a8ma bELqNZvAB9hmOBhNGlcWev2xpjJsMiSTB3B8Mja4rTDRuDBrF3ozmX7VQJVlRyl/6qohb5kXk9e 5McJWzOBI12M8aGMGYQRWd2D7i3rYharabho5g89BH X-Gm-Gg: ASbGncvLb2iyGcz/4Sqx0ihiYLs8tsiaH4BgsVSJDQKCnsLCPCOqTPvD1J//eZkMZD7 GDQrd7rdKOX/Wp6TDkvtneNaqb1eZ2zz2Hmo0eZgocaSDLhOQejAK8Yljm5aQFUr2VvQAcns2k/ FN2AO64S2DVgdzf053wddKW8tGj92knzN55kV552yxveqbJFk7o3M+g8fA8Yb6H49oT/AyrdgkH VPy/s/G5T0fJ3XIxI5J7rAoQiorInvwtlp1Wm+le4Wl3mWgcc/VzDV6LhBhkjo9+B3lltBmBkKN +u1D3LIGwQQclDUyttHC/I85F7nI+uf4/1O1obcBN71Fjiq5hVVnBwdMEa8gr8YftMTFq1RVbOi 47ubLedwYePf5qk6mag8d72yS8fDVgLbIPpqCqMItZthabZfFZmSSQIw3YnpK3s/ASvCmOgmcId HBile+38wd4LXVMEA= X-Received: by 2002:a05:6000:1842:b0:42b:3dfb:645f with SMTP id ffacd0b85a97d-42b59394e14mr14890715f8f.47.1763461787856; Tue, 18 Nov 2025 02:29:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IHxM6umTQhEgZK72WnzEFldINH1o88AssGbXSjfTL0sg5RYDSoBuxcNolXRLh8kjPhcIc4QzA== X-Received: by 2002:a05:6000:1842:b0:42b:3dfb:645f with SMTP id ffacd0b85a97d-42b59394e14mr14890686f8f.47.1763461787387; Tue, 18 Nov 2025 02:29:47 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: jsnow@redhat.com, alex.bennee@linaro.org Subject: [PATCH v2 1/3] mtest2make: cleanup mtest-suites variables Date: Tue, 18 Nov 2025 11:29:40 +0100 Message-ID: <20251118102942.551194-2-pbonzini@redhat.com> X-Mailer: git-send-email 2.51.1 In-Reply-To: <20251118102942.551194-1-pbonzini@redhat.com> References: <20251118102942.551194-1-pbonzini@redhat.com> MIME-Version: 1.0 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=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham 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 @redhat.com) X-ZM-MESSAGEID: 1763461834759153000 Content-Type: text/plain; charset="utf-8" Remove the "--suite" argument from the .*.mtest-suites variables, and add it only when actually computing the arguments to "meson test". This makes it possible to set ninja-cmd-goals from the set of suites, instead of doing it via many different .ninja-goals.* variables. Signed-off-by: Paolo Bonzini Reviewed-by: Alex Benn=C3=A9e --- Makefile | 4 +++- scripts/mtest2make.py | 40 +++++++++++++++++----------------------- 2 files changed, 20 insertions(+), 24 deletions(-) diff --git a/Makefile b/Makefile index 74c2da20372..9fb55dcf330 100644 --- a/Makefile +++ b/Makefile @@ -96,6 +96,8 @@ meson.stamp: config-host.mak =20 # 3. ensure meson-generated build files are up-to-date =20 +ninja-cmd-goals =3D + ifneq ($(NINJA),) Makefile.ninja: build.ninja $(quiet-@){ \ @@ -150,7 +152,7 @@ NINJAFLAGS =3D \ $(or $(filter -l% -j%, $(MAKEFLAGS)), \ $(if $(filter --jobserver-auth=3D%, $(MAKEFLAGS)),, -j1))) \ -d keepdepfile -ninja-cmd-goals =3D $(or $(MAKECMDGOALS), all) +ninja-cmd-goals +=3D $(or $(MAKECMDGOALS), all) ninja-cmd-goals +=3D $(foreach g, $(MAKECMDGOALS), $(.ninja-goals.$g)) =20 makefile-targets :=3D build.ninja ctags TAGS cscope dist clean diff --git a/scripts/mtest2make.py b/scripts/mtest2make.py index 2ef375fc6fb..891037e1d66 100644 --- a/scripts/mtest2make.py +++ b/scripts/mtest2make.py @@ -14,18 +14,18 @@ class Suite(object): def __init__(self): self.deps =3D set() - self.speeds =3D ['quick'] + self.speeds =3D [] =20 def names(self, base): - return [base if speed =3D=3D 'quick' else f'{base}-{speed}' for sp= eed in self.speeds] + return [f'{base}-{speed}' for speed in self.speeds] =20 =20 -print(''' +print(r''' SPEED =3D quick =20 -.speed.quick =3D $(foreach s,$(sort $(filter-out %-slow %-thorough, $1)), = --suite $s) -.speed.slow =3D $(foreach s,$(sort $(filter-out %-thorough, $1)), --suite = $s) -.speed.thorough =3D $(foreach s,$(sort $1), --suite $s) +.speed.quick =3D $(sort $(filter-out %-slow %-thorough, $1)) +.speed.slow =3D $(sort $(filter-out %-thorough, $1)) +.speed.thorough =3D $(sort $1) =20 TIMEOUT_MULTIPLIER ?=3D 1 .mtestargs =3D --no-rebuild -t $(TIMEOUT_MULTIPLIER) @@ -34,8 +34,10 @@ def names(self, base): endif .mtestargs +=3D $(subst -j,--num-processes , $(filter-out -j, $(lastword -= j1 $(filter -j%, $(MAKEFLAGS))))) =20 -.check.mtestargs =3D $(MTESTARGS) $(.mtestargs) $(if $(V),--verbose,--prin= t-errorlogs) -.bench.mtestargs =3D $(MTESTARGS) $(.mtestargs) --benchmark --verbose''') +.check.mtestargs =3D $(MTESTARGS) $(.mtestargs) $(if $(V),--verbose,--prin= t-errorlogs) \ + $(foreach s, $(sort $(.check.mtest-suites)), --suite $s) +.bench.mtestargs =3D $(MTESTARGS) $(.mtestargs) --benchmark --verbose \ + $(foreach s, $(sort $(.bench.mtest-suites)), --suite $s)''') =20 introspect =3D json.load(sys.stdin) =20 @@ -72,29 +74,21 @@ def emit_prolog(suites, prefix): print(f'all-{prefix}-targets =3D {all_targets}') print(f'all-{prefix}-xml =3D {all_xml}') print(f'.PHONY: {prefix} do-meson-{prefix} {prefix}-report.junit.xml $= (all-{prefix}-targets) $(all-{prefix}-xml)') - print(f'ifeq ($(filter {prefix}, $(MAKECMDGOALS)),)') - print(f'.{prefix}.mtestargs +=3D $(call .speed.$(SPEED), $(.{prefix}.m= test-suites))') - print(f'endif') + print(f'ninja-cmd-goals +=3D $(foreach s, $(.{prefix}.mtest-suites), $= (.{prefix}-$s.deps))') print(f'{prefix}-build: run-ninja') print(f'{prefix} $(all-{prefix}-targets): do-meson-{prefix}') print(f'do-meson-{prefix}: run-ninja; $(if $(MAKE.n),,+)$(MESON) test = $(.{prefix}.mtestargs)') print(f'{prefix}-report.junit.xml $(all-{prefix}-xml): {prefix}-report= %.junit.xml: run-ninja') print(f'\t$(MAKE) {prefix}$* MTESTARGS=3D"$(MTESTARGS) --logbase {pref= ix}-report$*" && ln -f meson-logs/$@ .') =20 -def emit_suite_deps(name, suite, prefix): - deps =3D ' '.join(suite.deps) - targets =3D [f'{prefix}-{name}', f'{prefix}-report-{name}.junit.xml', = f'{prefix}', f'{prefix}-report.junit.xml', - f'{prefix}-build'] - print() - print(f'.{prefix}-{name}.deps =3D {deps}') - for t in targets: - print(f'.ninja-goals.{t} +=3D $(.{prefix}-{name}.deps)') - def emit_suite(name, suite, prefix): - emit_suite_deps(name, suite, prefix) - targets =3D f'{prefix}-{name} {prefix}-report-{name}.junit.xml {prefix= } {prefix}-report.junit.xml' + deps =3D ' '.join(suite.deps) + targets =3D f'{prefix}-{name} {prefix}-report-{name}.junit.xml {prefix= } {prefix}-report.junit.xml {prefix}-build' + names =3D ' '.join(suite.names(name)) + print(f'.{prefix}-{name}.deps =3D {deps}') print(f'ifneq ($(filter {targets}, $(MAKECMDGOALS)),)') - print(f'.{prefix}.mtest-suites +=3D ' + ' '.join(suite.names(name))) + # for the "base" suite possibly add FOO-slow and FOO-thorough + print(f".{prefix}.mtest-suites +=3D {name} $(call .speed.$(SPEED), {na= mes})") print(f'endif') =20 targets =3D {t['id']: [os.path.relpath(f) for f in t['filename']] --=20 2.51.1