[edk2-devel] [PATCH v2] UefiCpuPkg/MtrrLib/UnitTest: Add host based unit test
Laszlo Ersek
lersek at redhat.com
Fri Jul 24 16:04:51 UTC 2020
On 07/24/20 08:41, Ray Ni wrote:
> 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 at intel.com>
> Signed-off-by: Michael D Kinney <michael.d.kinney at intel.com>
> Signed-off-by: Ming Shao <ming.shao at intel.com>
> Cc: Michael D Kinney <michael.d.kinney at intel.com>
> Cc: Ming Shao <ming.shao at intel.com>
> Cc: Eric Dong <eric.dong at intel.com>
> Cc: Ray Ni <ray.ni at intel.com>
> Cc: Laszlo Ersek <lersek at redhat.com>
> Cc: Sean Brogan <sean.brogan at microsoft.com>
> Cc: Bret Barkelew <Bret.Barkelew at microsoft.com>
> Cc: Jiewen Yao <jiewen.yao at intel.com>
> ---
> .../MtrrLib/UnitTest/MtrrLibUnitTest.c | 1140 +++++++++++++++++
> .../MtrrLib/UnitTest/MtrrLibUnitTest.h | 171 +++
> .../MtrrLib/UnitTest/MtrrLibUnitTestHost.inf | 39 +
> UefiCpuPkg/Library/MtrrLib/UnitTest/Support.c | 913 +++++++++++++
> UefiCpuPkg/Test/UefiCpuPkgHostTest.dsc | 31 +
> 5 files changed, 2294 insertions(+)
> create mode 100644 UefiCpuPkg/Library/MtrrLib/UnitTest/MtrrLibUnitTest.c
> create mode 100644 UefiCpuPkg/Library/MtrrLib/UnitTest/MtrrLibUnitTest.h
> create mode 100644 UefiCpuPkg/Library/MtrrLib/UnitTest/MtrrLibUnitTestHost.inf
> create mode 100644 UefiCpuPkg/Library/MtrrLib/UnitTest/Support.c
> create mode 100644 UefiCpuPkg/Test/UefiCpuPkgHostTest.dsc
Acked-by: Laszlo Ersek <lersek at redhat.com>
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#63249): https://edk2.groups.io/g/devel/message/63249
Mute This Topic: https://groups.io/mt/75761809/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-
More information about the edk2-devel-archive
mailing list