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 810CE740039 for ; Thu, 27 Mar 2025 04:08:51 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=uUso2pAs+cB84CjkIH3O8IpWvv8DNQE8kp3TMkhr+uc=; c=relaxed/simple; d=groups.io; h=Subject:To:From:User-Agent:MIME-Version:Date:Message-ID:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type; s=20240830; t=1743048531; v=1; x=1743307729; b=RQ4ZfPeVSth8OGs7+lFanystrUm4Zza1NjgVBYotObbFjL5GO09/gZQSJn/nXHe2u61aOwdY eXjWTH/VSRn/GCGLWbKUN67MLv1EskdptQFcFJwuphJToTM9UQc4PKZsNg70qnyaUKyoxJcI3gd IAiC5znQIYv+t1CvWIzaoAx4g5PzcxMqPGSeP74vLsK2Wt3CdSQpl1vwjyfu1AccUAv44YfKh/W x9PMJdO4uWx/dV4oeNEvSiyou4kG7tSF8Yk7U4u5fQe4M9RB/PoZO5gLkq/28xQoZ9BTPv2lql7 Sy464pMUupfoI+je2iXL1j164fMwKBFF3jymqe9eXtaAQ== X-Received: by 127.0.0.2 with SMTP id Rc0YYY7687511xgdTJ87BSRn; Wed, 26 Mar 2025 21:08:49 -0700 Subject: [edk2-devel] ACPI table generator unit test To: devel@edk2.groups.io From: "yodagump via groups.io" X-Originating-Location: Mountain View, California, US (104.133.9.84) X-Originating-Platform: Linux Chrome 134 User-Agent: GROUPS.IO Web Poster MIME-Version: 1.0 Date: Thu, 20 Mar 2025 15:56:55 -0700 Message-ID: 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 Reply-To: devel@edk2.groups.io,yodagump@google.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: GOf0g4bCtetGxQaRg7QGtpw7x7686176AA= Content-Type: multipart/alternative; boundary="rDIQnhWjZdGjQNuXP8ej" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240830 header.b=RQ4ZfPeV; 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 --rDIQnhWjZdGjQNuXP8ej Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi, I plan to use EDK2 unit test framework (https://github.com/SophiaWang-Googl= e/edk2/tree/master/UnitTestFrameworkPkg) to test ACPI table generator, such= as https://github.com/tianocore/edk2/blob/master/DynamicTablesPkg/Library/= Acpi/Arm/AcpiGtdtLibArm/GtdtGenerator.c However, ACPI table generator only has two non-static function exposed: EFI_STATUS EFIAPI AcpiGtdtLibConstructor ( IN =C2=A0EFI_HANDLE =C2=A0 =C2=A0 =C2=A0 =C2=A0ImageHandle, IN =C2=A0EFI_SYSTEM_TABLE =C2=A0*SystemTable ) EFI_STATUS EFIAPI AcpiGtdtLibDestructor ( IN =C2=A0EFI_HANDLE =C2=A0 =C2=A0 =C2=A0 =C2=A0ImageHandle, IN =C2=A0EFI_SYSTEM_TABLE =C2=A0*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 =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, IN =C2=A0CONST CM_STD_OBJ_ACPI_TABLE_INFO =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0*CONST =C2=A0AcpiTableInfo, IN =C2=A0CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL =C2=A0*CONST =C2=A0CfgM= grProtocol, OUT =C2=A0 =C2=A0 =C2=A0 EFI_ACPI_DESCRIPTION_HEADER =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0**CONST =C2=A0Table ) to non-static Please let me whether this is the approach upstream target for, or any bett= er solutions on this? Thank you, Sophia -=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 (#121226): https://edk2.groups.io/g/devel/message/121226 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- --rDIQnhWjZdGjQNuXP8ej Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable
Hi,
 
I plan to use EDK2 unit test framework (https://github.com/SophiaWang-= Google/edk2/tree/master/UnitTestFrameworkPkg) to test ACPI table generator,= such as https://github.com/tianocore/edk2/blob/master/DynamicTable= sPkg/Library/Acpi/Arm/AcpiGtdtLibArm/GtdtGenerator.c
 
However, ACPI table generator only has two non-static function exposed= :
EFI_STATUS
EFIAPI
AcpiGtdtLibConstructor (
  IN &n= bsp;EFI_HANDLE        ImageHandle,
  IN  = ;EFI_SYSTEM_TABLE  *SystemTable
  )

EFI_STATUSEFIAPI
AcpiGtdtLibDestructor (
  IN  EFI_HANDLE &nbs= p;      ImageHandle,
  IN  EFI_SYSTEM_TABLE &= nbsp;*SystemTable
  )
 
So if we want to use GoogleTest gMock to unit test ACPI table generato= r, I guess we need to expose API :
STATIC
EFI_STATUS
EFIAPI
BuildGtdtTable (
  I= N  CONST ACPI_TABLE_GENERATOR            = ;      *CONST  This,
  IN  CONST CM_STD_= OBJ_ACPI_TABLE_INFO            *CONST  A= cpiTableInfo,
  IN  CONST EDKII_CONFIGURATION_MANAGER_PROTOC= OL  *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
 
_._,_._,_

Groups.io Links:

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

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

_._,_._,_
--rDIQnhWjZdGjQNuXP8ej--