diff options
author | Michael D Kinney <michael.d.kinney@intel.com> | 2020-01-22 10:16:14 -0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2020-02-07 19:18:53 +0000 |
commit | 184ee9b1de4ecd1ea4aa479dc66840a14f50ccb2 (patch) | |
tree | d65906240000fe42636eaf140e14b78fdec01685 /MdeModulePkg/Test | |
parent | e50c2bb38398553b184cee7d96d676a12b4c064b (diff) | |
download | edk2-184ee9b1de4ecd1ea4aa479dc66840a14f50ccb2.zip edk2-184ee9b1de4ecd1ea4aa479dc66840a14f50ccb2.tar.gz edk2-184ee9b1de4ecd1ea4aa479dc66840a14f50ccb2.tar.bz2 |
MdeModulePkg: Add DxeResetSystemLib unit test
https://bugzilla.tianocore.org/show_bug.cgi?id=2505
* Add unit test of DxeResetSystemLib library
instance that uses cmocka interfaces to mock the
UEFI Runtime Services Table and its ResetSystem()
service. When a unit test uses the cmocka
interfaces, the unit test does not support being
run from target environments.
cmocka APIs: https://api.cmocka.org/index.html
This example puts the unit test in a UnitTest
directory below the library INF file and this location
means the unit test is only designed to work this
this one library instance.
* Add Test/MdeModulePkgHostTest.dsc to build host
based unit tests
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Acked-by: Hao A Wu <hao.a.wu@intel.com>
Reviewed-by: Bret Barkelew <Bret.Barkelew@microsoft.com>
Diffstat (limited to 'MdeModulePkg/Test')
-rw-r--r-- | MdeModulePkg/Test/MdeModulePkgHostTest.dsc | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/MdeModulePkg/Test/MdeModulePkgHostTest.dsc b/MdeModulePkg/Test/MdeModulePkgHostTest.dsc new file mode 100644 index 0000000..72a119d --- /dev/null +++ b/MdeModulePkg/Test/MdeModulePkgHostTest.dsc @@ -0,0 +1,32 @@ +## @file
+# MdeModulePkg DSC file used to build host-based unit tests.
+#
+# Copyright (c) 2019 - 2020, Intel Corporation. All rights reserved.<BR>
+# Copyright (C) Microsoft Corporation.
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+[Defines]
+ PLATFORM_NAME = MdeModulePkgHostTest
+ PLATFORM_GUID = F74AF7C6-698C-4EBA-BA49-FF6816916354
+ PLATFORM_VERSION = 0.1
+ DSC_SPECIFICATION = 0x00010005
+ OUTPUT_DIRECTORY = Build/MdeModulePkg/HostTest
+ SUPPORTED_ARCHITECTURES = IA32|X64
+ BUILD_TARGETS = NOOPT
+ SKUID_IDENTIFIER = DEFAULT
+
+!include UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc
+
+[Components]
+ MdeModulePkg/Library/DxeResetSystemLib/UnitTest/MockUefiRuntimeServicesTableLib.inf
+
+ #
+ # Build MdeModulePkg HOST_APPLICATION Tests
+ #
+ MdeModulePkg/Library/DxeResetSystemLib/UnitTest/DxeResetSystemLibUnitTestHost.inf {
+ <LibraryClasses>
+ ResetSystemLib|MdeModulePkg/Library/DxeResetSystemLib/DxeResetSystemLib.inf
+ UefiRuntimeServicesTableLib|MdeModulePkg/Library/DxeResetSystemLib/UnitTest/MockUefiRuntimeServicesTableLib.inf
+ }
|