From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9454CC36010 for ; Tue, 1 Apr 2025 16:01:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 131AC10E60C; Tue, 1 Apr 2025 16:01:47 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="grYZu4vs"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.14]) by gabe.freedesktop.org (Postfix) with ESMTPS id B623210E624 for ; Tue, 1 Apr 2025 16:01:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1743523306; x=1775059306; h=date:message-id:from:to:cc:subject:in-reply-to: references:mime-version:content-transfer-encoding; bh=ENhd2fYBDtZcyWfKe56w2U7TpcnGYK0Wldsem/QyUpQ=; b=grYZu4vs4e3GXJqMtcSCsKgLd7kHOjD+7+AN/2FW/4ABQVgJeaJxy7He Yua9mNzr4mY5eOR/unBE8IE66ryeNj+yTqexsiJANKUirajGD9zYgsbH0 nhPWHMljc91FU77EbfZicpbPSM5mVrajnoDoDzVTQ/aCKIIWwJkGGtb7O Qmws5mzKaWwA7uJO5M3Ohuqw57O4YPajGXNLLMKD9XM77imQS6oUqRltl ctFXKcPMvl+0T9Boyiuf54wj6YIIWf47Ehps93HdZds+iRZOmXgLy8OG3 ZOr2Mg5glTFJRRgLixxjvL5VA7su76eiZYSRttu8+ZaC+BL0jRJroxn2V g==; X-CSE-ConnectionGUID: 2Kw8qS5cSdqyUgVLGEP4Dw== X-CSE-MsgGUID: H1nt+Y9uRPyCPJkvbh4jqw== X-IronPort-AV: E=McAfee;i="6700,10204,11391"; a="48647202" X-IronPort-AV: E=Sophos;i="6.14,293,1736841600"; d="scan'208";a="48647202" Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by orvoesa106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Apr 2025 09:01:45 -0700 X-CSE-ConnectionGUID: HLKDVfsuRs2GlnDEtm/RWg== X-CSE-MsgGUID: Z+QAoohGQJScE3zZAeQkvQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.14,293,1736841600"; d="scan'208";a="130554001" Received: from orsosgc001.jf.intel.com (HELO orsosgc001.intel.com) ([10.165.21.142]) by fmviesa003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Apr 2025 09:01:44 -0700 Date: Tue, 01 Apr 2025 09:01:44 -0700 Message-ID: <85frirswev.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" To: Kamil Konieczny Cc: igt-dev@lists.freedesktop.org, Andrzej Hajda , Zbigniew =?ISO-8859-2?Q?Kempczy=F1ski?= , Katarzyna Piecielska Subject: Re: [PATCH i-g-t v3 2/2] CONTRIBUTING: Add guide about igt libraries In-Reply-To: <20250401153025.48366-3-kamil.konieczny@linux.intel.com> References: <20250401153025.48366-1-kamil.konieczny@linux.intel.com> <20250401153025.48366-3-kamil.konieczny@linux.intel.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/29.4 (x86_64-redhat-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=ISO-8859-2 Content-Transfer-Encoding: quoted-printable X-BeenThere: igt-dev@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development mailing list for IGT GPU Tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" On Tue, 01 Apr 2025 08:30:25 -0700, Kamil Konieczny wrote: > > Add some general guide about adding new library function and > a few guides for their usage outside of tests. Reviewed-by: Ashutosh Dixit > > Cc: Andrzej Hajda > Cc: Zbigniew Kempczy=F1ski > Signed-off-by: Kamil Konieczny > Acked-by: Katarzyna Piecielska > --- > CONTRIBUTING.md | 28 ++++++++++++++++++++++++++++ > 1 file changed, 28 insertions(+) > > diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md > index 2927e0ca1..4ffd9a0a4 100644 > --- a/CONTRIBUTING.md > +++ b/CONTRIBUTING.md > @@ -38,6 +38,34 @@ The Code > > [igt-describe]: https://drm.pages.freedesktop.org/igt-gpu-tools/igt-gpu-= tools-Core.html#igt-describe > > +IGT libraries > +------------- > +- Tests and benchmarks are the main usage of IGT libraries, so they > + could use test specific macros/functions, for example igt_assert, > + igt_require, igt_skip, igt_info or igt_debug. > + > +- New library function could be written when it will have at least two > + different users, for example if it could be used by two or more tests. > + In some cases single user can be accepted, when it is very likely it > + will be used in future. > + > +- In a new library function(): > + if it uses some of the macros igt_assert/igt_require/igt_skip then > + consider to write also __function() with the same functionality but > + without them. > + > +- Libraries and igt_runner > + Runner should not use lib functions. It is crucial for CI runs so using > + libraries puts a risk of bringing changes meant for tests which in turn > + could break runner. > + Note: You will find places where igt_runner uses lib functions - this = will > + be on ToDo list to be fixed. > + > +- Libraries and tools/ > + Give some thought if you are planning to use IGT lib code in tools, so= me > + IGT lib functions might not be appropriate in tools. For example, any > + abnormal condition should be simply reported by printf or fprintf to > + stdout/stderr and then tool should exit gracefully. > > Sending Patches > --------------- > -- > 2.49.0 >