From 184ee9b1de4ecd1ea4aa479dc66840a14f50ccb2 Mon Sep 17 00:00:00 2001 From: Michael D Kinney Date: Wed, 22 Jan 2020 10:16:14 -0800 Subject: 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 Cc: Bret Barkelew Cc: Liming Gao Cc: Hao A Wu Signed-off-by: Michael D Kinney Acked-by: Hao A Wu Reviewed-by: Bret Barkelew --- MdeModulePkg/MdeModulePkg.ci.yaml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'MdeModulePkg/MdeModulePkg.ci.yaml') diff --git a/MdeModulePkg/MdeModulePkg.ci.yaml b/MdeModulePkg/MdeModulePkg.ci.yaml index 0bf149f205..3b6e747075 100644 --- a/MdeModulePkg/MdeModulePkg.ci.yaml +++ b/MdeModulePkg/MdeModulePkg.ci.yaml @@ -9,6 +9,10 @@ "CompilerPlugin": { "DscPath": "MdeModulePkg.dsc" }, + ## options defined ci/Plugin/HostUnitTestCompilerPlugin + "HostUnitTestCompilerPlugin": { + "DscPath": "Test/MdeModulePkgHostTest.dsc" + }, ## options defined ci/Plugin/CharEncodingCheck "CharEncodingCheck": { @@ -24,7 +28,9 @@ "ArmPkg/ArmPkg.dec" # this should be fixed by promoting an abstraction ], # For host based unit tests - "AcceptableDependencies-HOST_APPLICATION":[], + "AcceptableDependencies-HOST_APPLICATION":[ + "UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec" + ], # For UEFI shell based apps "AcceptableDependencies-UEFI_APPLICATION":[], "IgnoreInf": [] @@ -35,6 +41,11 @@ "IgnoreInf": [], "DscPath": "MdeModulePkg.dsc" }, + ## options defined ci/Plugin/HostUnitTestDscCompleteCheck + "HostUnitTestDscCompleteCheck": { + "IgnoreInf": [""], + "DscPath": "Test/MdeModulePkgHostTest.dsc" + }, ## options defined ci/Plugin/GuidCheck "GuidCheck": { -- cgit v1.2.3