mirror of
				https://github.com/acidanthera/audk.git
				synced 2025-10-31 03:03:46 +01:00 
			
		
		
		
	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>
		
			
				
	
	
		
			43 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			INI
		
	
	
	
	
	
			
		
		
	
	
			43 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			INI
		
	
	
	
	
	
| ## @file
 | |
| # Unit tests of the CpuPageTableLib instance of the CpuPageTableLib class
 | |
| #
 | |
| # Copyright (c) 2022, Intel Corporation. All rights reserved.<BR>
 | |
| # SPDX-License-Identifier: BSD-2-Clause-Patent
 | |
| ##
 | |
| 
 | |
| [Defines]
 | |
|   INF_VERSION                    = 0x00010006
 | |
|   BASE_NAME                      = CpuPageTableLibUnitTestHost
 | |
|   FILE_GUID                      = D8DC32C2-7272-43A8-B145-1723BED8E119
 | |
|   MODULE_TYPE                    = HOST_APPLICATION
 | |
|   VERSION_STRING                 = 1.0
 | |
| 
 | |
| #
 | |
| # The following information is for reference only and not required by the build tools.
 | |
| #
 | |
| #  VALID_ARCHITECTURES           = IA32 X64
 | |
| #
 | |
| 
 | |
| [Sources]
 | |
|   CpuPageTableLibUnitTestHost.c
 | |
|   RandomTest.c
 | |
|   TestHelper.c
 | |
|   RandomNumber.c
 | |
|   RandomTest.h
 | |
|   CpuPageTableLibUnitTest.h
 | |
| 
 | |
| [Packages]
 | |
|   MdePkg/MdePkg.dec
 | |
|   UefiCpuPkg/UefiCpuPkg.dec
 | |
|   UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec
 | |
|   CryptoPkg/CryptoPkg.dec
 | |
| 
 | |
| [LibraryClasses]
 | |
|   BaseLib
 | |
|   BaseMemoryLib
 | |
|   DebugLib
 | |
|   CpuPageTableLib
 | |
|   UnitTestLib
 | |
|   MemoryAllocationLib
 | |
|   BaseCryptLib
 |