From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id 6C121740047 for ; Thu, 27 Mar 2025 16:56:14 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=dgiwywmM3qlkCy2Tt2lplSZwoA2eXqV8cckmnf+0siU=; c=relaxed/simple; d=groups.io; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject:To:Cc:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type; s=20240830; t=1743094574; v=1; x=1743353772; b=xAqDzNFY1izh3gwgY2xHFmuUWk2ly0Fuu0/oJEbv3uIGTD7wobnM0zrskYcmTupktBCcPmez Nm7p4enA7U5u7Pgza4EmEpp0/vkOgwIKBBHnKuxL1fYARomfmVN0JthsImudleXrxWaGImu+y4Q VywClPWp9v1Vwq0WaXlQ0D2QIGFdOWRIr5k5Kqg97Y+BaToTm0vxQmoHv6UA3FviJkBIgEndd0x PTVVrZRG/H5GXrrCr4VISfV3W2+iIbakA3VgGQ6uJ4yQsGAMXkKQPDjRQ5zZ6hDbBSH3DR99vR5 cPlYl9m2m77+3OzfE3krNts2PC1CVhDSTmaszCuFhHi0A== X-Received: by 127.0.0.2 with SMTP id fE0jYY7687511xIkWmgPO4u8; Thu, 27 Mar 2025 09:56:12 -0700 X-Received: from mail-ej1-f54.google.com (mail-ej1-f54.google.com [209.85.218.54]) by mx.groups.io with SMTP id smtpd.web11.1461.1743094571727394236 for ; Thu, 27 Mar 2025 09:56:12 -0700 X-Received: by mail-ej1-f54.google.com with SMTP id a640c23a62f3a-ac29fd22163so215193266b.3 for ; Thu, 27 Mar 2025 09:56:11 -0700 (PDT) X-Gm-Message-State: jQHVvQg4ddJy432UQ2uI8lMjx7686176AA= X-Gm-Gg: ASbGncv96EYO3pvVTjY9SsoJSoN3EvZN2N/o6tAf4IMUYsQz5MA6WM61etoEgbhbCj2 JV6b2azafVbqTiUYUQUTXcNtiX3Zn8nreYjMobENlkqvtXXoPow6M/EEdjepANukgefYpLhvxy9 UXjkqqq4O5yLZ/YYcEHKO/T3AV+IYYWelWpXUZgEqbmpYohwJvEhhwZ/g= X-Google-Smtp-Source: AGHT+IFAu7hVazZ9wrFfFV9zVzCLoPB1jEPc2mUHeJ6RB5SsP0EIaXYSTU/VIEKT59fjzYBC/+DKyY8nAInn33PjTx4= X-Received: by 2002:a17:907:1c28:b0:ac6:e33a:31fc with SMTP id a640c23a62f3a-ac6fb14c8b7mr480321366b.51.1743094569711; Thu, 27 Mar 2025 09:56:09 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: "Sophia Wang via groups.io" Date: Thu, 27 Mar 2025 09:55:33 -0700 X-Gm-Features: AQ5f1JrxgRa8TFJkdI2zlr5uG-K-lN8ZggUdhplk17dN9Awbrx6Ji3zv9_e15zg Message-ID: Subject: Re: [edk2-devel] ACPI table generator unit test To: Sami Mujawar Cc: "devel@edk2.groups.io" , "Jeff Brasen (jbrasen@nvidia.com)" , Pierre Gondois , Yeo Reum Yun , Sarah Walker Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Resent-Date: Thu, 27 Mar 2025 09:56:12 -0700 Resent-From: yodagump@google.com Reply-To: devel@edk2.groups.io,yodagump@google.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Type: multipart/alternative; boundary="000000000000a3ceca063155d44a" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240830 header.b=xAqDzNFY; dmarc=pass (policy=none) header.from=groups.io; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io --000000000000a3ceca063155d44a Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thanks Sami for the reply. https://github.com/tianocore/edk2/pull/10833/files is indeed adding mock configuration manager protocols for unit tests. But the issue for unit test code cannot call the build function of ACPI table generator still exists. Currently we only have two non-static function exposed EFI_STATUS EFIAPI AcpiGtdtLibConstructor ( IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable ) EFI_STATUS EFIAPI AcpiGtdtLibDestructor ( IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable ) And IMO, we need to expose more functions as non-static for the ACPI table unit test purpose. Please feel free to share your insights. Best, Sophia On Thu, Mar 27, 2025 at 6:37=E2=80=AFAM Sami Mujawar = wrote: > Hi Sophia, > > > > Unfortunately, I am not conversant with the Google Test framework. I will > need to get around to understanding it at some point. > > > > However, there is a recent PR that adds some tests. Can you take a look a= t > the patch at: > https://github.com/tianocore/edk2/pull/10833/commits/4eeeb1434820718ace16= 70d9429a867fe5e8c9b7 > > to see if it helps, please? > > > > Regards, > > > > Sami Mujawar > > *From: *devel@edk2.groups.io on behalf of yodagump > via groups.io > *Date: *Thursday, 27 March 2025 at 04:10 > *To: *devel@edk2.groups.io > *Subject: *[edk2-devel] ACPI table generator unit test > > Hi, > > > > I plan to use EDK2 unit test framework ( > https://github.com/SophiaWang-Google/edk2/tree/master/UnitTestFrameworkPk= g) > to test ACPI table generator, such as > https://github.com/tianocore/edk2/blob/master/DynamicTablesPkg/Library/Ac= pi/Arm/AcpiGtdtLibArm/GtdtGenerator.c > > > > However, ACPI table generator only has two non-static function exposed: > > EFI_STATUS > EFIAPI > AcpiGtdtLibConstructor ( > IN EFI_HANDLE ImageHandle, > IN EFI_SYSTEM_TABLE *SystemTable > ) > > EFI_STATUS > EFIAPI > AcpiGtdtLibDestructor ( > IN EFI_HANDLE ImageHandle, > IN EFI_SYSTEM_TABLE *SystemTable > ) > > > > So if we want to use GoogleTest gMock to unit test ACPI table generator, = I > guess we need to expose API : > > STATIC > EFI_STATUS > EFIAPI > BuildGtdtTable ( > IN CONST ACPI_TABLE_GENERATOR *CONST This, > IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST AcpiTableInfo, > IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, > OUT EFI_ACPI_DESCRIPTION_HEADER **CONST Table > ) > > to non-static > > > > Please let me whether this is the approach upstream target for, or any > better solutions on this? > > > > Thank you, > > Sophia > > > >=20 > IMPORTANT NOTICE: The contents of this email and any attachments are > confidential and may also be privileged. If you are not the intended > recipient, please notify the sender immediately and do not disclose the > contents to any other person, use it for any purpose, or store or copy th= e > information in any medium. Thank you. > -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#121231): https://edk2.groups.io/g/devel/message/121231 Mute This Topic: https://groups.io/mt/111930977/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- --000000000000a3ceca063155d44a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Tha= nks Sami for the reply.

<= a href=3D"https://github.com/tianocore/edk2/pull/10833/files">https://githu= b.com/tianocore/edk2/pull/10833/files is indeed adding mock configurati= on manager protocols for unit tests. But the issue for unit test code canno= t call the build function of ACPI table generator still exists. Currently w= e only have two non-static function exposed=C2=A0

EFI_STATUS
EFIAPI
AcpiGtdtLibConstructor (=
=C2=A0 IN =C2=A0EFI_HANDLE =C2=A0 =C2=A0 =C2=A0 =C2=A0ImageHandle,
= =C2=A0 IN =C2=A0EFI_SYSTEM_TABLE =C2=A0*SystemTable
=C2=A0 )

EFI_= STATUS
EFIAPI
AcpiGtdtLibDestructor (
=C2=A0 IN =C2=A0EFI_HANDLE = =C2=A0 =C2=A0 =C2=A0 =C2=A0ImageHandle,
=C2=A0 IN =C2=A0EFI_SYSTEM_TABLE= =C2=A0*SystemTable
=C2=A0 )=C2=A0

And IMO= , we need to expose more functions=C2=A0as non-static for the ACPI table un= it test purpose. Please feel free to share your insights.

Best,
Sophia

On Thu, Mar 27,= 2025 at 6:37=E2=80=AFAM Sami Mujawar <Sami.Mujawar@arm.com> wrote:

Hi Sophia,<= /u>

=C2=A0<= /span>

Unfortunately, I am n= ot conversant with the Google Test framework. I will need to get around to = understanding it at some point.

=C2=A0<= /span>

However, there is a r= ecent PR that adds some tests. Can you take a look at the patch at: https://github.com/tianocore/edk2/pull/10833/commits/4eeeb1434820718ace1670= d9429a867fe5e8c9b7

to see if it helps, p= lease?

=C2=A0<= /span>

Regards,

=C2=A0<= /span>

Sami Mujawar

From: devel@edk2.groups.io <devel@edk2.groups.io> on behalf of= yodagump via groups.io = <yodagump=3Dgo= ogle.com@groups.io>
Date: Thursday, 27 March 2025 at 04:10
To: devel@= edk2.groups.io <devel@edk2.groups.io>
Subject: [edk2-devel] ACPI table generator unit test

Hi,

=C2=A0

=C2=A0

However, ACPI table generator only has two non-stati= c function exposed:

EFI_STATUS
EFIAPI
AcpiGtdtLibConstructor (
=C2=A0 IN =C2=A0EFI_HANDLE =C2=A0 =C2=A0 =C2=A0 =C2=A0ImageHandle,
=C2=A0 IN =C2=A0EFI_SYSTEM_TABLE =C2=A0*SystemTable
=C2=A0 )

EFI_STATUS
EFIAPI
AcpiGtdtLibDestructor (
=C2=A0 IN =C2=A0EFI_HANDLE =C2=A0 =C2=A0 =C2=A0 =C2=A0ImageHandle,
=C2=A0 IN =C2=A0EFI_SYSTEM_TABLE =C2=A0*SystemTable
=C2=A0 )

=C2=A0

So if we want to use GoogleTest gMock to unit test A= CPI table generator, I guess we need to expose API :

STATIC
EFI_STATUS
EFIAPI
BuildGtdtTable (
=C2=A0 IN =C2=A0CONST ACPI_TABLE_GENERATOR =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0*CONST =C2=A0This,
=C2=A0 IN =C2=A0CONST CM_STD_OBJ_ACPI_TABLE_INFO =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0*CONST =C2=A0AcpiTableInfo,
=C2=A0 IN =C2=A0CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL =C2=A0*CONST =C2= =A0CfgMgrProtocol,
=C2=A0 OUT =C2=A0 =C2=A0 =C2=A0 EFI_ACPI_DESCRIPTION_HEADER =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0**CONST =C2=A0Table
=C2=A0 )

to non-static

=C2=A0

Please let me whether this is the approach upstream = target for, or any better solutions on this?=C2=A0

=C2=A0

Thank you,

Sophia

=C2=A0

IMPORTANT NOTICE: The contents of this email and any attachments are confid= ential and may also be privileged. If you are not the intended recipient, p= lease notify the sender immediately and do not disclose the contents to any= other person, use it for any purpose, or store or copy the information in any medium. Thank you.
_._,_._,_

Groups.io Links:

=20 You receive all messages sent to this group. =20 =20

View/Reply Online (#121231) | =20 | Mute= This Topic | New Topic
Your Subscriptio= n | Contact Group Owner | Unsubscribe [rebecca@openfw.io]

_._,_._,_
--000000000000a3ceca063155d44a--