-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
87b10e6
commit 5a22ca6
Showing
4 changed files
with
75 additions
and
0 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
UefiCpuPkg/Test/Mock/Include/GoogleTest/Library/MockTimerLib.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/** @file MockTimerLib.h | ||
Google Test mocks for TimerLib | ||
Copyright (c) Microsoft Corporation. | ||
SPDX-License-Identifier: BSD-2-Clause-Patent | ||
**/ | ||
|
||
#ifndef MOCK_TIMER_LIB_H_ | ||
#define MOCK_TIMER_LIB_H_ | ||
|
||
#include <Library/GoogleTestLib.h> | ||
#include <Library/FunctionMockLib.h> | ||
extern "C" { | ||
#include <Library/TimerLib.h> | ||
} | ||
|
||
struct MockTimerLib { | ||
MOCK_INTERFACE_DECLARATION (MockTimerLib); | ||
|
||
MOCK_FUNCTION_DECLARATION ( | ||
UINTN, | ||
MicroSecondDelay, | ||
( | ||
IN UINTN MicroSeconds | ||
) | ||
); | ||
}; | ||
|
||
#endif //MOCK_TIMER_LIB_H_ |
11 changes: 11 additions & 0 deletions
11
UefiCpuPkg/Test/Mock/Library/GoogleTest/MockTimerLib/MockTimerLib.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/** @file MockTimerLib.cpp | ||
Google Test mocks for TimerLib | ||
Copyright (c) Microsoft Corporation. | ||
SPDX-License-Identifier: BSD-2-Clause-Patent | ||
**/ | ||
|
||
#include <GoogleTest/Library/MockTimerLib.h> | ||
|
||
MOCK_INTERFACE_DEFINITION (MockTimerLib); | ||
MOCK_FUNCTION_DEFINITION (MockTimerLib, MicroSecondDelay, 1, EFIAPI); |
34 changes: 34 additions & 0 deletions
34
UefiCpuPkg/Test/Mock/Library/GoogleTest/MockTimerLib/MockTimerLib.inf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
## @file MockTimerLib.inf | ||
# Google Test mocks for TimerLib | ||
# | ||
# Copyright (c) Microsoft Corporation. | ||
# SPDX-License-Identifier: BSD-2-Clause-Patent | ||
## | ||
|
||
[Defines] | ||
INF_VERSION = 0x00010005 | ||
BASE_NAME = MockTimerLib | ||
FILE_GUID = CF06C23E-5B46-4CC9-A5AE-794E0E58A564 | ||
MODULE_TYPE = HOST_APPLICATION | ||
VERSION_STRING = 1.0 | ||
LIBRARY_CLASS = TimerLib | ||
|
||
# | ||
# The following information is for reference only and not required by the build tools. | ||
# | ||
# VALID_ARCHITECTURES = IA32 X64 | ||
# | ||
|
||
[Sources] | ||
MockTimerLib.cpp | ||
|
||
[Packages] | ||
UefiCpuPkg/UefiCpuPkg.dec | ||
MdePkg/MdePkg.dec | ||
UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec | ||
|
||
[LibraryClasses] | ||
GoogleTestLib | ||
|
||
[BuildOptions] | ||
MSFT:*_*_*_CC_FLAGS = /EHsc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters