Add host based unit tests for the MtrrLib services. The BaseLib services AsmCpuid(), AsmReadMsr64(), and AsmWriteMsr64() are hooked and provide simple emulation of the CPUID leafs and MSRs required by the MtrrLib to run as a host based unit test. Test cases are developed for each of the API. For the most important APIs MtrrSetMemoryAttributesInMtrrSettings() and MtrrSetMemoryAttributeInMtrrSettings(), random inputs are generated and fed to the APIs to make sure the implementation is good. The test application accepts an optional parameter which specifies how many iterations of feeding random inputs to the two APIs. The overall number of test cases increases when the iteration increases. Default iteration is 10 when no parameter is specified. Signed-off-by: Ray Ni <ray.ni@intel.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Signed-off-by: Ming Shao <ming.shao@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Ming Shao <ming.shao@intel.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com> Cc: Jiewen Yao <jiewen.yao@intel.com>
65 lines
2.1 KiB
YAML
65 lines
2.1 KiB
YAML
## @file
|
|
# CI configuration for UefiCpuPkg
|
|
#
|
|
# Copyright (c) Microsoft Corporation
|
|
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
|
##
|
|
{
|
|
"LicenseCheck": {
|
|
"IgnoreFiles": []
|
|
},
|
|
"CompilerPlugin": {
|
|
"DscPath": "UefiCpuPkg.dsc"
|
|
},
|
|
## options defined ci/Plugin/HostUnitTestCompilerPlugin
|
|
"HostUnitTestCompilerPlugin": {
|
|
"DscPath": "Test/UefiCpuPkgHostTest.dsc"
|
|
},
|
|
"CharEncodingCheck": {
|
|
"IgnoreFiles": []
|
|
},
|
|
"DependencyCheck": {
|
|
"AcceptableDependencies": [
|
|
"MdePkg/MdePkg.dec",
|
|
"MdeModulePkg/MdeModulePkg.dec",
|
|
"UefiCpuPkg/UefiCpuPkg.dec"
|
|
],
|
|
# For host based unit tests
|
|
"AcceptableDependencies-HOST_APPLICATION":[
|
|
"UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec"
|
|
],
|
|
# For UEFI shell based apps
|
|
"AcceptableDependencies-UEFI_APPLICATION":[],
|
|
"IgnoreInf": []
|
|
},
|
|
"DscCompleteCheck": {
|
|
"DscPath": "UefiCpuPkg.dsc",
|
|
"IgnoreInf": [
|
|
"UefiCpuPkg/ResetVector/FixupVtf/Vtf.inf",
|
|
"UefiCpuPkg/ResetVector/Vtf0/Vtf0.inf"
|
|
]
|
|
},
|
|
"HostUnitTestDscCompleteCheck": {
|
|
"IgnoreInf": [""],
|
|
"DscPath": "Test/UefiCpuPkgHostTest.dsc"
|
|
},
|
|
"GuidCheck": {
|
|
"IgnoreGuidName": ["SecCore", "ResetVector"], # Expected duplication for gEfiFirmwareVolumeTopFileGuid
|
|
"IgnoreGuidValue": [],
|
|
"IgnoreFoldersAndFiles": [],
|
|
"IgnoreDuplicates": []
|
|
},
|
|
"LibraryClassCheck": {
|
|
"IgnoreHeaderFile": []
|
|
},
|
|
|
|
## options defined ci/Plugin/SpellCheck
|
|
"SpellCheck": {
|
|
"AuditOnly": True, # Fails test but run in AuditOnly mode to collect log
|
|
"IgnoreFiles": [], # use gitignore syntax to ignore errors in matching files
|
|
"ExtendWords": [], # words to extend to the dictionary for this package
|
|
"IgnoreStandardPaths": [], # Standard Plugin defined paths that should be ignore
|
|
"AdditionalIncludePaths": [] # Additional paths to spell check (wildcards supported)
|
|
}
|
|
}
|