diff options
author | Ray Ni <ray.ni@intel.com> | 2020-05-20 05:13:11 +0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2020-08-12 11:38:37 +0000 |
commit | e17f459af2594b6ccbb8d56064737b8a23414b76 (patch) | |
tree | 9899a0603e5a071ec4ffafa49ba5c3c89cfd8816 /UefiCpuPkg/UefiCpuPkg.ci.yaml | |
parent | be01087e07809d20aa2db27b37029c324c824407 (diff) | |
download | edk2-e17f459af2594b6ccbb8d56064737b8a23414b76.zip edk2-e17f459af2594b6ccbb8d56064737b8a23414b76.tar.gz edk2-e17f459af2594b6ccbb8d56064737b8a23414b76.tar.bz2 |
UefiCpuPkg/MtrrLib/UnitTest: Add host based unit test
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>
Diffstat (limited to 'UefiCpuPkg/UefiCpuPkg.ci.yaml')
-rw-r--r-- | UefiCpuPkg/UefiCpuPkg.ci.yaml | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/UefiCpuPkg/UefiCpuPkg.ci.yaml b/UefiCpuPkg/UefiCpuPkg.ci.yaml index d54651d..140cb5a 100644 --- a/UefiCpuPkg/UefiCpuPkg.ci.yaml +++ b/UefiCpuPkg/UefiCpuPkg.ci.yaml @@ -11,6 +11,10 @@ "CompilerPlugin": {
"DscPath": "UefiCpuPkg.dsc"
},
+ ## options defined ci/Plugin/HostUnitTestCompilerPlugin
+ "HostUnitTestCompilerPlugin": {
+ "DscPath": "Test/UefiCpuPkgHostTest.dsc"
+ },
"CharEncodingCheck": {
"IgnoreFiles": []
},
@@ -21,7 +25,9 @@ "UefiCpuPkg/UefiCpuPkg.dec"
],
# For host based unit tests
- "AcceptableDependencies-HOST_APPLICATION":[],
+ "AcceptableDependencies-HOST_APPLICATION":[
+ "UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec"
+ ],
# For UEFI shell based apps
"AcceptableDependencies-UEFI_APPLICATION":[],
"IgnoreInf": []
@@ -33,6 +39,10 @@ "UefiCpuPkg/ResetVector/Vtf0/Vtf0.inf"
]
},
+ "HostUnitTestDscCompleteCheck": {
+ "IgnoreInf": [""],
+ "DscPath": "Test/UefiCpuPkgHostTest.dsc"
+ },
"GuidCheck": {
"IgnoreGuidName": ["SecCore", "ResetVector"], # Expected duplication for gEfiFirmwareVolumeTopFileGuid
"IgnoreGuidValue": [],
|