Skip to content

Commit

Permalink
Create a host-based mock for UefiBootServicesTableLib
Browse files Browse the repository at this point in the history
  • Loading branch information
brbarkel@microsoft.com authored and kenlautner committed May 9, 2023
1 parent 8b09a51 commit 1e67e06
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/** @file
Mock implementation of the UEFI Boot Services Table Library.
Copyright (C) Microsoft Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent
**/

#include <Uefi.h>

extern EFI_BOOT_SERVICES MockBoot;

EFI_BOOT_SERVICES *gBS = &MockBoot;
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
## @file
# Mock implementation of the UEFI Boot Services Table Library.
#
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##

[Defines]
INF_VERSION = 0x00010005
BASE_NAME = MockUefiBootServicesTableLib
FILE_GUID = 67EA4614-E276-49EC-9AE6-B97ACCEA676E
MODULE_TYPE = HOST_APPLICATION
VERSION_STRING = 1.0
LIBRARY_CLASS = UefiBootServicesTableLib|HOST_APPLICATION

#
# VALID_ARCHITECTURES = IA32 X64 EBC
#

[Sources]
MockUefiBootServicesTableLib.c

[Packages]
MdePkg/MdePkg.dec
1 change: 1 addition & 0 deletions MdePkg/Test/MdePkgHostTest.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
MdePkg/Test/UnitTest/Library/BaseLib/BaseLibUnitTestsHost.inf
MdePkg/Test/GoogleTest/Library/BaseSafeIntLib/GoogleTestBaseSafeIntLib.inf
# MU_CHANGE [BEGIN]
MdePkg/Test/Library/MockUefiBootServicesTableLib/MockUefiBootServicesTableLib.inf
MdePkg/Test/Library/MockUefiRuntimeServicesTableLib/MockUefiRuntimeServicesTableLib.inf
MdePkg/Test/Library/StubHobLib/StubHobLib.inf
MdePkg/Test/Library/StubUefiLib/StubUefiLib.inf
Expand Down

0 comments on commit 1e67e06

Please sign in to comment.