* [edk2-devel] ACPI table generator unit test @ 2025-03-20 22:56 yodagump via groups.io 2025-03-27 13:36 ` Sami Mujawar via groups.io 0 siblings, 1 reply; 3+ messages in thread From: yodagump via groups.io @ 2025-03-20 22:56 UTC (permalink / raw) To: devel [-- Attachment #1: Type: text/plain, Size: 1567 bytes --] 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/DynamicTablesPkg/Library/Acpi/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 -=-=-=-=-=-=-=-=-=-=-=- 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] -=-=-=-=-=-=-=-=-=-=-=- [-- Attachment #2: Type: text/html, Size: 2692 bytes --] ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [edk2-devel] ACPI table generator unit test 2025-03-20 22:56 [edk2-devel] ACPI table generator unit test yodagump via groups.io @ 2025-03-27 13:36 ` Sami Mujawar via groups.io 2025-03-27 16:55 ` Sophia Wang via groups.io 0 siblings, 1 reply; 3+ messages in thread From: Sami Mujawar via groups.io @ 2025-03-27 13:36 UTC (permalink / raw) To: devel@edk2.groups.io, yodagump@google.com, Jeff Brasen (jbrasen@nvidia.com), Pierre Gondois, Yeo Reum Yun, Sarah Walker [-- Attachment #1: Type: text/plain, Size: 2520 bytes --] 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 at the patch at: https://github.com/tianocore/edk2/pull/10833/commits/4eeeb1434820718ace1670d9429a867fe5e8c9b7 to see if it helps, please? Regards, Sami Mujawar From: devel@edk2.groups.io <devel@edk2.groups.io> on behalf of yodagump via groups.io <yodagump=google.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, 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/DynamicTablesPkg/Library/Acpi/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 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 the information in any medium. Thank you. -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#121229): https://edk2.groups.io/g/devel/message/121229 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] -=-=-=-=-=-=-=-=-=-=-=- [-- Attachment #2: Type: text/html, Size: 7560 bytes --] ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [edk2-devel] ACPI table generator unit test 2025-03-27 13:36 ` Sami Mujawar via groups.io @ 2025-03-27 16:55 ` Sophia Wang via groups.io 0 siblings, 0 replies; 3+ messages in thread From: Sophia Wang via groups.io @ 2025-03-27 16:55 UTC (permalink / raw) To: Sami Mujawar Cc: devel@edk2.groups.io, Jeff Brasen (jbrasen@nvidia.com), Pierre Gondois, Yeo Reum Yun, Sarah Walker [-- Attachment #1: Type: text/plain, Size: 3552 bytes --] 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 AM Sami Mujawar <Sami.Mujawar@arm.com> 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 at > the patch at: > https://github.com/tianocore/edk2/pull/10833/commits/4eeeb1434820718ace1670d9429a867fe5e8c9b7 > > to see if it helps, please? > > > > Regards, > > > > Sami Mujawar > > *From: *devel@edk2.groups.io <devel@edk2.groups.io> on behalf of yodagump > via groups.io <yodagump=google.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, > > > > 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/DynamicTablesPkg/Library/Acpi/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 > > > > > 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 the > information in any medium. Thank you. > -=-=-=-=-=-=-=-=-=-=-=- 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] -=-=-=-=-=-=-=-=-=-=-=- [-- Attachment #2: Type: text/html, Size: 7928 bytes --] ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-03-27 16:56 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2025-03-20 22:56 [edk2-devel] ACPI table generator unit test yodagump via groups.io 2025-03-27 13:36 ` Sami Mujawar via groups.io 2025-03-27 16:55 ` Sophia Wang via groups.io
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox