summaryrefslogtreecommitdiff
path: root/MdePkg/Test/Mock/Include/GoogleTest/Library
AgeCommit message (Collapse)AuthorFilesLines
2026-08-31MdePkg: Add GoogleTest mock for RngLibMarc Chen1-0/+49
Add a reusable GoogleTest mock implementation covering all public RngLib APIs. Include it in MdePkgHostTest.dsc so CI validates the mock with host-based unit tests. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Signed-off-by: Marc Chen <marc.chen@microsoft.com>
2026-08-31MdePkg: Add GoogleTest mock for PeCoffLibMarc Chen1-0/+61
Add a reusable GoogleTest mock implementation covering all public PeCoffLib APIs. Include it in MdePkgHostTest.dsc so CI validates the mock with host-based unit tests. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Signed-off-by: Marc Chen <marc.chen@microsoft.com>
2026-07-16MdePkg: added mock for InstallConfigurationTableAlexander Gryanko1-0/+7
InstallConfigurationTable is used in the AddImageExeInfo call and is necessary for outputting information about the binary file in case of an error. Mock has been added for the DxeImageVerificationHandler subroutine. Signed-off-by: Alexander Gryanko <xpahos@gmail.com>
2026-06-25MdePkg: Follow pragma once coding conventionMichael Kubacki15-60/+15
Update recent changes in MdePkg to follow the latest EDK II C Coding Standards Specification (5.3) to use '#pragma once' instead of traditional macro-based include guards in header files. https://tianocore-docs.github.io/edk2-CCodingStandardsSpecification/draft/5_source_files/53_include_files.html#53-include-files Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2026-06-02MdePkg: Added MockUefiRuntimeLibPaddy Deng (AMI US Holdings Inc)1-0/+156
Added mock library for UefiRuntimeLib for google test Signed-off-by: Paddy Deng (AMI US Holdings Inc) <v-dengpaddy@microsoft.com>
2026-06-02MdePkg: Added MockUefiDevicePathLibPaddy Deng (AMI US Holdings Inc)1-0/+159
Added moc library for UefiDevicePathLib for google test Signed-off-by: Paddy Deng (AMI US Holdings Inc) <v-dengpaddy@microsoft.com>
2026-06-02MdePkg: Added MockSynchronizationLibPaddy Deng (AMI US Holdings Inc)1-0/+118
Added mock library for SynchronizationLib for google test Signed-off-by: Paddy Deng (AMI US Holdings Inc) <v-dengpaddy@microsoft.com>
2026-06-02MdePkg: Added MockSmmMemLibPaddy Deng (AMI US Holdings Inc)1-0/+83
Added mock library for SmmMemLib for google test Signed-off-by: Paddy Deng (AMI US Holdings Inc) <v-dengpaddy@microsoft.com>
2026-06-02MdePkg: Added MockPerformanceLibPaddy Deng (AMI US Holdings Inc)1-0/+106
Added mock library for PerformanceLib for google test Signed-off-by: Paddy Deng (AMI US Holdings Inc) <v-dengpaddy@microsoft.com>
2026-06-02MdePkg: Added MockPciLibPaddy Deng (AMI US Holdings Inc)1-0/+127
Added mock library for PciLib for google test Signed-off-by: Paddy Deng (AMI US Holdings Inc) <v-dengpaddy@microsoft.com>
2026-06-02MdePkg: Added MockPciExpressLibPaddy Deng (AMI US Holdings Inc)1-0/+45
Added mock librart for PciExpressLib for google test Signed-off-by: Paddy Deng (AMI US Holdings Inc) <v-dengpaddy@microsoft.com>
2026-06-02MdePkg: Added MockPciCf8LibPaddy Deng (AMI US Holdings Inc)1-0/+318
Added mock library for PciCf8Lib for google test Signed-off-by: Paddy Deng (AMI US Holdings Inc) <v-dengpaddy@microsoft.com>
2026-06-02MdePkg: Added MockPcdLibPaddy Deng (AMI US Holdings Inc)1-0/+300
Added mock library for PcdLib for google test Signed-off-by: Paddy Deng (AMI US Holdings Inc) <v-dengpaddy@microsoft.com>
2026-06-02MdePkg: Added MockMmServicesTableLibPaddy Deng (AMI US Holdings Inc)1-0/+166
Added mock library for MmServicesTableLib for google test Signed-off-by: Paddy Deng (AMI US Holdings Inc) <v-dengpaddy@microsoft.com>
2026-06-02MdePkg: Added MockMemoryAllocationLibPaddy Deng (AMI US Holdings Inc)1-0/+166
Added mock library for MemoryAllocationLib for google test Signed-off-by: Paddy Deng (AMI US Holdings Inc) <v-dengpaddy@microsoft.com>
2026-06-02MdePkg: Added MockIoLibPaddy Deng (AMI US Holdings Inc)1-0/+962
Added mock library for IoLib for google test Signed-off-by: Paddy Deng (AMI US Holdings Inc) <v-dengpaddy@microsoft.com>
2026-06-02MdePkg: Added MockDxeServicesTableLibPaddy Deng (AMI US Holdings Inc)1-0/+31
Added mock library for DxeServicesTableLib for google test Signed-off-by: Paddy Deng (AMI US Holdings Inc) <v-dengpaddy@microsoft.com>
2026-06-02MdePkg: Added MockDxeServicesLibPaddy Deng (AMI US Holdings Inc)1-0/+100
Added mock library for DxeServicesLib for google test Signed-off-by: Paddy Deng (AMI US Holdings Inc) <v-dengpaddy@microsoft.com>
2026-04-02MdePkg: Added several mock libraries for google testPaddyDeng2-2/+164
Added several mock libraries for google test so one can make google test drives consuming those libraries: - MockReportStatusCodeLib - MockSerialPortLib Signed-off-by: Paddy Deng <PaddyDeng@ami.com>
2026-03-24MdePkg/BaseFdtLib: FdtGetName, FdtGetPathAntaeus Kleinert-Strand1-7/+7
Update FdtGetName() and FdtGetPath() to correctly mark the VOID *Fdt as a CONST variable. This aligns with the internal libfdt implementation. Update MockFdtLib.h to align with the updated inputs for FdtGetName() and FdtGetPath(). Signed-off-by: Antaeus Kleinert-Strand <antklein@microsoft.com>
2026-02-24MdePkg: Replace include guards with #pragma onceMichael Kubacki13-52/+13
Replace traditional `#ifndef`/`#define`/`#endif` include guards with `#pragma` once. `#pragma once` is a widely supported preprocessor directive that prevents header files from being included multiple times. It is supported by all toolchains used to build edk2: GCC, Clang/LLVM, and MSVC. Compared to macro-based include guards, `#pragma once`: - Eliminates the risk of macro name collisions or copy/paste errors where two headers inadvertently use the same guard macro. - Eliminate inconsistency in the way include guard macros are named (e.g., some files use `__FILE_H__`, others use `FILE_H_`, etc.). - Reduces boilerplate (three lines replaced by one). - Avoids polluting the macro namespace with guard symbols. - Can improve build times as the preprocessor can skip re-opening the file entirely, rather than re-reading it to find the matching `#endif` ("multiple-include optimization"). - Note that some compilers may already optimize traditional include guards, by recognzining the idiomatic pattern. This change is made acknowledging that overall portability of the code will technically be reduced, as `#pragma once` is not part of the C/C++ standards. However, this is considered acceptable given: 1. edk2 already defines a subset of supported compilers in BaseTools/Conf/tools_def.template, all of which have supported `#pragma once` for over two decades. 2. There have been concerns raised to the project about inconsistent include guard naming and potential macro collisions. Approximate compiler support dates: - MSVC: Supported since Visual C++ 4.2 (1996) - GCC: Supported since 3.4 (2004) (http://gnu.ist.utl.pt/software/gcc/gcc-3.4/changes.html) - Clang (LLVM based): Since initial release in 2007 Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2025-10-06MdePkg/MockFdtLib: add FdtLib mock functionsBob Morgan1-0/+14
Add FdtDelNode() and FdtGetPath() mock functions. Signed-off-by: Bob Morgan <bobm@nvidia.com>
2025-08-07MdePkg: added mocks for DevicePathLib and OpenProtocolAlexander Gryanko2-0/+207
Added Google Mock test support for DevicePathLib. Added OpenProtocol and CloseProtocol for UefiBootServicesTableLib mock library. Signed-off-by: Alexander Gryanko <xpahos@gmail.com>
2025-04-18MdePkg: Add two new APIs in HobLibDun Tan1-0/+12
This commit is to add two new APIs in MdePkg PeiHobLib, DxeHobLib, DxeCoreHobLib and MockHobLib: 1.The GetNextMemoryAllocationGuidHob () returns the next instance of the Memory Allocation HOB with the matched GUID from a starting HOB pointer. 2.The TagMemoryAllocationHobWithGuid () searchs the HOB list for the Memory Allocation HOB with a matching base address and set the Name GUID. Then the instance of the tagged Memory Allocation HOB with matched base address is returned. Signed-off-by: Dun Tan <dun.tan@intel.com>
2024-12-11MdePkg: Add Google Mock Library for SafeIntLibTsunFeng1-0/+1001
Signed-off-by: TsunFeng <v-tshuang@microsoft.com>
2024-10-30MdePkg: Add Google Mock Library for PostCodeLibTsunFeng1-0/+56
Signed-off-by: TsunFeng <v-tshuang@microsoft.com>
2024-10-28MdePkg/MockUefiLib: Added new mock functions.v-sbolisetti1-4/+338
Signed-off-by: v-sbolisetti <v-sbolisetti@microsoft.com>
2024-10-17MdePkg: Add Google Test Library and Protocolv-chhsieh4-0/+609
Mock Libraries: MdePkg\Test\Mock\Library\GoogleTest\MockCpuLib MdePkg\Test\Mock\Library\GoogleTest\MockPciSegmentLib MdePkg\Test\Mock\Library\GoogleTest\MockReportStatusCodeLib MdePkg\Test\Mock\Library\GoogleTest\MockSmmServicesTableLib Mock Protocol: MdePkg\Test\Mock\Include\GoogleTest\Protocol\MockMpService.h Signed-off-by: jack Hsieh <v-chhsieh@microsoft.com> Cc: Maintainer Shruti Gupta <shrugupt@microsoft.com> Cc: Reviewer Shruti Gupta <shrugupt@microsoft.com>
2024-10-02MdePkg: consistently use "Property" in BaseFdtLibLeif Lindholm1-2/+2
There is currently a mix on functions named as Prop or Property. The latter is in majority, and the better fit for tianocore coding style, so rename FdtNodeOffsetByPropValue () and FdtSetProp () for consistency. To avoid breaking bisect, change existing users in UefiPayloadPkg. Continuous-integration-options: PatchCheck.ignore-multi-package Signed-off-by: Leif Lindholm <quic_llindhol@quicinc.com>
2024-05-24MdePkg: Add MockUefiBootServicesTableLibDoug Flick1-0/+78
This commit adds a mock library for UefiBootServicesTableLib. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Zhiguang Liu <zhiguang.liu@intel.com> Signed-off-by: Doug Flick [MSFT] <doug.edk2@gmail.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2024-02-06MdePkg: Test: Add gRT_GetTime Google Test MockDoug Flick via groups.io1-0/+7
This adds support for GetTime Google Test Mock Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Zhiguang Liu <zhiguang.liu@intel.com> Signed-off-by: Doug Flick [MSFT] <doug.edk2@gmail.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
2024-01-24MdePkg: Add FdtLib gmock supportdevel@edk2.groups.io1-0/+164
Add Google Mock Library for FdtLib Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Zhiguang Liu <zhiguang.liu@intel.com> Signed-off-by: Jeff Brasen <jbrasen@nvidia.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Gua Guo <gua.guo@intel.com>
2023-10-27MdePkg: Apply uncrustify formatting to relevant filesVivian Nowka-Keane4-10/+10
Apply uncrustify formatting to GoogleTest cpp and header files. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Zhiguang Liu <zhiguang.liu@intel.com> Signed-off-by: Vivian Nowka-Keane <vnowkakeane@linux.microsoft.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
2023-05-10MdePkg: Add more HobLib/PeiServicesLib gmock supportGua Guo2-0/+339
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4443 Add Google Mock Library for HobLib Add Google Mock Library for PeiServicesLib Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Zhiguang Liu <zhiguang.liu@intel.com> Cc: Chris Johnson <chris.n.johnson@intel.com> Signed-off-by: Gua Guo <gua.guo@intel.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
2023-04-10MdePkg: Add gmock examplesChris Johnson2-0/+81
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4389 Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Zhiguang Liu <zhiguang.liu@intel.com> Signed-off-by: Chris Johnson <chris.n.johnson@intel.com> Acked-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Oliver Smith-Denny <osde@linux.microsoft.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>