From nobody Fri Dec 12 19:22:42 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1764851871; cv=none; d=zohomail.com; s=zohoarc; b=YcIyKoTk52I/R3JY29MoCoZWfhiKSvBcRbfvJYZpffKxKp6xkeRo5Egx+HHgHHPlvh0KVvzaYtzu4XneSnEC/qVWHSuAaMCEbZDC4wOlkrGYidJPl5H3YZKhKV3ZkCGS4VLQeRq/ZLUoCqkdsFRrx9OAA2nnnbtuVL2mvJ7ZhFg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1764851871; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ylriBSJTPr4LVY5YvsyHXSHnemIkW1zWJXnMiOjYfUQ=; b=SGVe84C+rx7Mq25/5/OVdAAQ2peffmaHwxmLlt+tH489yp9ftxlr/k7E5wDMt2wFfihy64/cGGx40ePkVvz/0Gv3OfecxOQlRRbf9ja2TYF1J7ofMFUT+e19gGx+YnqTyImuJnO6hmp/U6+LzroNFHB8WA7IbJP3xYog4JeCPnQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 176485187196263.32668000790284; Thu, 4 Dec 2025 04:37:51 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.1177628.1501859 (Exim 4.92) (envelope-from ) id 1vR8aK-0007Af-FE; Thu, 04 Dec 2025 12:37:24 +0000 Received: by outflank-mailman (output) from mailman id 1177628.1501859; Thu, 04 Dec 2025 12:37:24 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vR8aK-000796-Bv; Thu, 04 Dec 2025 12:37:24 +0000 Received: by outflank-mailman (input) for mailman id 1177628; Thu, 04 Dec 2025 12:37:23 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vR8aJ-00077w-3X for xen-devel@lists.xenproject.org; Thu, 04 Dec 2025 12:37:23 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.96) (envelope-from ) id 1vR8aI-006XHh-1b; Thu, 04 Dec 2025 12:37:22 +0000 Received: from [19.12.91.86] (helo=localhost) by xenbits.xenproject.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vR8aH-003f3a-2M; Thu, 04 Dec 2025 12:37:22 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org; s=20200302mail; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:Cc:To:From; bh=ylriBSJTPr4LVY5YvsyHXSHnemIkW1zWJXnMiOjYfUQ=; b=U/+nOv9PsNsfnOwVXKTSHmWMNG sz90gpT14WBrobV+UoXbyPj/FavxqfkOdVr8n/peFmmrY1HvldA2614+hD3JIWqY28PM9ba6bETYm h9sdOhvEWJqmieKyqljQ2zxOJR9hMwU6wYi/55Iy99KfPncX352+wh08MQdHufFL2cbg=; From: dmukhin@xen.org To: xen-devel@lists.xenproject.org Cc: andrew.cooper3@citrix.com, anthony.perard@vates.tech, jbeulich@suse.com, julien@xen.org, michal.orzel@amd.com, roger.pau@citrix.com, sstabellini@kernel.org, dmukhin@ford.com Subject: [PATCH v1 1/2] tests: fixup domid test harness dependencies Date: Thu, 4 Dec 2025 04:37:11 -0800 Message-ID: <20251204123712.721443-2-dmukhin@ford.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251204123712.721443-1-dmukhin@ford.com> References: <20251204123712.721443-1-dmukhin@ford.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @xen.org) X-ZM-MESSAGEID: 1764851873349019200 Content-Type: text/plain; charset="utf-8" From: Denis Mukhin =20 There can be multiple test harnesses per one test target. Fix that by iterating over all prerequisites in emit-harness-nested-rule(). Signed-off-by: Denis Mukhin --- tools/tests/domid/Makefile | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tools/tests/domid/Makefile b/tools/tests/domid/Makefile index 753129029ed9..1a2129d20655 100644 --- a/tools/tests/domid/Makefile +++ b/tools/tests/domid/Makefile @@ -14,16 +14,18 @@ $(shell sed -n \ 's/^[ \t]*# *include[ \t]*[<"]\([^">]*\)[">].*/\1/p' $(1) 2>/dev/null) endef =20 -# NB: $1 cannot be a list +# $1 target +# $2 list of test harnesses define emit-harness-nested-rule -$(1): $(CURDIR)/harness.h - mkdir -p $$(@D); - ln -sf $$< $$@; +$(1): $(2) + mkdir -p $$(@D); \ + for i in $$<; do ln -sf $$$$i $$@; done =20 endef =20 define emit-harness-rules -$(foreach x,$(2),$(call emit-harness-nested-rule,$(CURDIR)/generated/$(x))) +$(foreach x,$(2),$(call \ + emit-harness-nested-rule,$(CURDIR)/generated/$(x),$(CURDIR)/harness.h)) $(1:.c=3D.o): $(addprefix $(CURDIR)/generated/,$(2)) endef =20 --=20 2.52.0 From nobody Fri Dec 12 19:22:42 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1764851864; cv=none; d=zohomail.com; s=zohoarc; b=X6UwwEzVqHk4mLXY8QY6Pf+h8SZF5u3BPoL3klQOefAPb+uDHjgndip7bqQHp2xbWL7Hse2mfAvSQXwH4Bi34Ew6thyvYsQZcI29UnEQ9EwHRscRHLelGB5lAWqj+3W9FUJiHMFPDaf0oV+GtHPtvcfP74I8kIhkwRyyvaors7w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1764851864; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=s/LQz+Ny8Hleos9w4vzzFVh/9qQd0WL7V/RtNKKknKA=; b=Xa11a9vYUThdn28SMae3WCeA7B1rb4nKKcEIC2bMG5q0TKo64jQ49gzqpn5mufQ0SUCf8c/1UOeug1J+BZ6WV3GTsei3MjwJvh8Dct7OGB5QIINbgrDdITxSzEfIq/odN/q8SiAsVGZngKsqjzcUoMD9osyYrWWIXk4zy8ZedtA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1764851864305275.7354966832344; Thu, 4 Dec 2025 04:37:44 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.1177629.1501876 (Exim 4.92) (envelope-from ) id 1vR8aL-0007Yz-LO; Thu, 04 Dec 2025 12:37:25 +0000 Received: by outflank-mailman (output) from mailman id 1177629.1501876; Thu, 04 Dec 2025 12:37:25 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vR8aL-0007Ys-Ir; Thu, 04 Dec 2025 12:37:25 +0000 Received: by outflank-mailman (input) for mailman id 1177629; Thu, 04 Dec 2025 12:37:24 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vR8aK-000783-4c for xen-devel@lists.xenproject.org; Thu, 04 Dec 2025 12:37:24 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.96) (envelope-from ) id 1vR8aJ-006XHq-1j; Thu, 04 Dec 2025 12:37:23 +0000 Received: from [19.12.91.86] (helo=localhost) by xenbits.xenproject.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vR8aI-003f92-2k; Thu, 04 Dec 2025 12:37:23 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org; s=20200302mail; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:Cc:To:From; bh=s/LQz+Ny8Hleos9w4vzzFVh/9qQd0WL7V/RtNKKknKA=; b=fPEBJ0apMHurlkOfAHd/kxfgTN KAPqU7njjzofZ3m9pO7ZJ8t1IlGIa1cBba/vXz65VOUQQ0J4U2s/AqqCnnaIdisji7FrQ3b4WhDWk cxJakLlETBlTv2dfG2mZ6m1dIKbzGk5eLDP3CDXNOCDgWarqgoseV6v6xcaYFpt+T43I=; From: dmukhin@xen.org To: xen-devel@lists.xenproject.org Cc: andrew.cooper3@citrix.com, anthony.perard@vates.tech, jbeulich@suse.com, julien@xen.org, michal.orzel@amd.com, roger.pau@citrix.com, sstabellini@kernel.org, dmukhin@ford.com Subject: [PATCH v1 2/2] tests: introduce Tests.mk fragment Date: Thu, 4 Dec 2025 04:37:12 -0800 Message-ID: <20251204123712.721443-3-dmukhin@ford.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251204123712.721443-1-dmukhin@ford.com> References: <20251204123712.721443-1-dmukhin@ford.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @xen.org) X-ZM-MESSAGEID: 1764851865449019200 Content-Type: text/plain; charset="utf-8" From: Denis Mukhin =20 Add new make fragment for unit tests with auto-generated test harness dependencies. Signed-off-by: Denis Mukhin --- tools/Tests.mk | 34 ++++++++++++++++++++++++++++++++++ tools/tests/domid/Makefile | 30 +----------------------------- 2 files changed, 35 insertions(+), 29 deletions(-) create mode 100644 tools/Tests.mk diff --git a/tools/Tests.mk b/tools/Tests.mk new file mode 100644 index 000000000000..fe941209db0f --- /dev/null +++ b/tools/Tests.mk @@ -0,0 +1,34 @@ +# SPDX-License-Identifier: GPL-2.0-only +# +# Unit test fragment. +# +# Copyright 2025 Ford Motor Company + +define list-c-headers +$(shell sed -n \ + 's/^[ \t]*# *include[ \t]*[<"]\([^">]*\)[">].*/\1/p' $(1) 2>/dev/null) +endef + +# $1 target +# $2 list of test harnesses +define emit-harness-nested-rule +$(1): $(2) + mkdir -p $$(@D); \ + for i in $$<; do ln -sf $$$$i $$@; done + +endef + +define emit-harness-rules +$(foreach x,$(2),$(call \ + emit-harness-nested-rule,$(CURDIR)/generated/$(x),$(CURDIR)/harness.h)) +$(1:.c=3D.o): $(addprefix $(CURDIR)/generated/,$(2)) +endef + +define emit-harness-deps +$(if $(strip $(2)),$(call emit-harness-rules,$1,$2),) +endef + +define vpath-with-harness-deps +vpath $(1) $(2) +$(call emit-harness-deps,$(1),$(call list-c-headers,$(2)$(1))) +endef diff --git a/tools/tests/domid/Makefile b/tools/tests/domid/Makefile index 1a2129d20655..51a465ce6318 100644 --- a/tools/tests/domid/Makefile +++ b/tools/tests/domid/Makefile @@ -6,38 +6,10 @@ =20 XEN_ROOT=3D$(CURDIR)/../../.. include $(XEN_ROOT)/tools/Rules.mk +include $(XEN_ROOT)/tools/Tests.mk =20 TESTS :=3D test-domid =20 -define list-c-headers -$(shell sed -n \ - 's/^[ \t]*# *include[ \t]*[<"]\([^">]*\)[">].*/\1/p' $(1) 2>/dev/null) -endef - -# $1 target -# $2 list of test harnesses -define emit-harness-nested-rule -$(1): $(2) - mkdir -p $$(@D); \ - for i in $$<; do ln -sf $$$$i $$@; done - -endef - -define emit-harness-rules -$(foreach x,$(2),$(call \ - emit-harness-nested-rule,$(CURDIR)/generated/$(x),$(CURDIR)/harness.h)) -$(1:.c=3D.o): $(addprefix $(CURDIR)/generated/,$(2)) -endef - -define emit-harness-deps -$(if $(strip $(2)),$(call emit-harness-rules,$1,$2),) -endef - -define vpath-with-harness-deps -vpath $(1) $(2) -$(call emit-harness-deps,$(1),$(call list-c-headers,$(2)$(1))) -endef - .PHONY: all all: $(TESTS) =20 --=20 2.52.0