Files
system76-edk2/UefiCpuPkg/Test/UefiCpuPkgHostTest.dsc
Zhiguang Liu 04ecdc38cd UefiCpuPkg/CpuPageTableLib/UnitTest: Add host based unit test
Add host based unit tests for the CpuPageTableLib services.

Unit test focuses on PageTableMap function, containing two kinds of test
cases: manual test case and random test case.
Manual test case creates some corner case to test function PageTableMap.
Random test case generates multiple random memory entries (with random
attribute) as the input of function PageTableMap to get the output
pagetable. Output pagetable will be validated and be parsed to get output
memory entries, and then the input and output memory entries will be
compared to verify the functionality.

The unit test is not perfect yet. There are options for random test, and
some of them control the test coverage, and some option are not ready.
Will enhance in the future.

Cc: Eric Dong <eric.dong@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
2022-08-31 01:57:58 +00:00

41 lines
1.3 KiB
Plaintext

## @file
# UefiCpuPkg DSC file used to build host-based unit tests.
#
# Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
[Defines]
PLATFORM_NAME = UefiCpuPkgHostTest
PLATFORM_GUID = E00B9599-5B74-4FF7-AB9F-8183FB13B2F9
PLATFORM_VERSION = 0.1
DSC_SPECIFICATION = 0x00010005
OUTPUT_DIRECTORY = Build/UefiCpuPkg/HostTest
SUPPORTED_ARCHITECTURES = IA32|X64
BUILD_TARGETS = NOOPT
SKUID_IDENTIFIER = DEFAULT
!include UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc
[LibraryClasses]
MtrrLib|UefiCpuPkg/Library/MtrrLib/MtrrLib.inf
CpuPageTableLib|UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableLib.inf
OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
BaseCryptLib|CryptoPkg/Library/BaseCryptLib/UnitTestHostBaseCryptLib.inf
RngLib|MdePkg/Library/BaseRngLib/BaseRngLib.inf
[PcdsPatchableInModule]
gUefiCpuPkgTokenSpaceGuid.PcdCpuNumberOfReservedVariableMtrrs|0
[Components]
#
# Build HOST_APPLICATION that tests the MtrrLib
#
UefiCpuPkg/Library/MtrrLib/UnitTest/MtrrLibUnitTestHost.inf
#
# Build HOST_APPLICATION that tests the CpuPageTableLib
#
UefiCpuPkg/Library/CpuPageTableLib/UnitTest/CpuPageTableLibUnitTestHost.inf