Skip to content

Commit

Permalink
MdePkg: Add Google Test Library and Protocol
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: Maintainer Shruti Gupta <[email protected]>
Cc: Reviewer   Shruti Gupta <[email protected]>
  • Loading branch information
v-chhsieh authored and mergify[bot] committed Oct 17, 2024
1 parent 866abb2 commit 6e197a8
Show file tree
Hide file tree
Showing 14 changed files with 996 additions and 0 deletions.
4 changes: 4 additions & 0 deletions MdePkg/Test/MdePkgHostTest.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,9 @@
MdePkg/Test/Mock/Library/GoogleTest/MockPeiServicesLib/MockPeiServicesLib.inf
MdePkg/Test/Mock/Library/GoogleTest/MockHobLib/MockHobLib.inf
MdePkg/Test/Mock/Library/GoogleTest/MockFdtLib/MockFdtLib.inf
MdePkg/Test/Mock/Library/GoogleTest/MockSmmServicesTableLib/MockSmmServicesTableLib.inf
MdePkg/Test/Mock/Library/GoogleTest/MockCpuLib/MockCpuLib.inf
MdePkg/Test/Mock/Library/GoogleTest/MockPciSegmentLib/MockPciSegmentLib.inf
MdePkg/Test/Mock/Library/GoogleTest/MockReportStatusCodeLib/MockReportStatusCodeLib.inf

MdePkg/Library/StackCheckLibNull/StackCheckLibNullHostApplication.inf
64 changes: 64 additions & 0 deletions MdePkg/Test/Mock/Include/GoogleTest/Library/MockCpuLib.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/** @file MockCpuLib.h
Google Test mocks for the CPU Library
Copyright (c) Microsoft Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent
**/

#ifndef MOCK_CPU_LIB_H_
#define MOCK_CPU_LIB_H_

#include <Library/GoogleTestLib.h>
#include <Library/FunctionMockLib.h>

extern "C" {
#include <Uefi.h>
}

struct MockCpuLib {
MOCK_INTERFACE_DECLARATION (MockCpuLib);

MOCK_FUNCTION_DECLARATION (
VOID,
CpuSleep,
(
)
);

MOCK_FUNCTION_DECLARATION (
VOID,
CpuFlushTlb,
(
)
);

MOCK_FUNCTION_DECLARATION (
VOID,
InitializeFloatingPointUnits,
(
)
);

MOCK_FUNCTION_DECLARATION (
BOOLEAN,
StandardSignatureIsAuthenticAMD,
(
)
);

MOCK_FUNCTION_DECLARATION (
UINT32,
GetCpuFamilyModel,
(
)
);

MOCK_FUNCTION_DECLARATION (
UINT8,
GetCpuSteppingId,
(
)
);
};

#endif
Loading

0 comments on commit 6e197a8

Please sign in to comment.