https://bugzilla.tianocore.org/show_bug.cgi?id=2797 https://bugzilla.tianocore.org/show_bug.cgi?id=2798 https://bugzilla.tianocore.org/show_bug.cgi?id=2799 https://bugzilla.tianocore.org/show_bug.cgi?id=2800 https://bugzilla.tianocore.org/show_bug.cgi?id=2801 https://bugzilla.tianocore.org/show_bug.cgi?id=2803 https://bugzilla.tianocore.org/show_bug.cgi?id=2804 https://bugzilla.tianocore.org/show_bug.cgi?id=2805 https://bugzilla.tianocore.org/show_bug.cgi?id=2806
* Add Null base libraries for host based unit tests * Add host based test version of BaseLib with hooks for servicees that use privlidged instructions. * Add new UT_EXPECT_ASSERT_FAILURE() macro to UnitTestLib class * Enable source level debug of unit tests * Increase stack size to 256KB for host based tests on Windows * Update BaseTools to support NULL libs for HOST_APPLICATION modules * Guarantee print log works even if unit test generates an exception * Use filename instead of function name in target mode logs Cc: Liming Gao <liming....@intel.com> Cc: Bob Feng <bob.c.f...@intel.com> Cc: Sean Brogan <sean.bro...@microsoft.com> Cc: Bret Barkelew <bret.barke...@microsoft.com> Cc: Jiewen Yao <jiewen....@intel.com> Signed-off-by: Michael D Kinney <michael.d.kin...@intel.com> Michael D Kinney (15): BaseTools/Python: Allow HOST_APPLICATION to use NULL libraries MdePkg/BaseCpuLibNull: Add Null version of CpuLib for host testing MdePkg/BaseCacheMaintenanceLibNull: Add Null instance for host testing MdePkg/BaseLib: Break out IA32/X64 GCC inline privileged functions MdePkg/Library/BaseLib: Add BaseLib instance for host based unit tests UnitTestFrameworkPkg: Use host libraries from MdePkg UnitTestFrameworkPkg: Enable source level debug for host tests UnitTestFrameworkPkg: Set host application stack size to 256KB UnitTestFrameworkPkg: Change target mode DebugLib mapping UnitTestFrameworkPkg/UnitTestLib: Move print log into cleanup UnitTestFrameworkPkg/UnitTestLib: Fix target mode log messages UnitTestFrameworkPkg/UnitTestLib: Add checks for ASSERT() MdePkg/Include: Hook DebugLib _ASSERT() for unit tests MdePkg/Include: Add UT_EXPECT_ASSERT_FAILURE() to UnitTestLib UnitTestFramewokPkg/SampleUnitTest: Use UT_EXPECT_ASSERT_FAILURE() .../Python/Workspace/WorkspaceCommon.py | 4 +- MdePkg/Include/Library/DebugLib.h | 28 +- MdePkg/Include/Library/UnitTestLib.h | 70 + .../BaseCacheMaintenanceLibNull.c | 225 ++ .../BaseCacheMaintenanceLibNull.inf | 29 + .../BaseCacheMaintenanceLibNull.uni | 12 + .../Library/BaseCpuLibNull/BaseCpuLibNull.c | 37 + .../Library/BaseCpuLibNull/BaseCpuLibNull.inf | 26 + .../Library/BaseCpuLibNull/BaseCpuLibNull.uni | 11 + MdePkg/Library/BaseLib/BaseLib.inf | 4 +- MdePkg/Library/BaseLib/Ia32/GccInline.c | 1181 +------ .../Ia32/{GccInline.c => GccInlinePriv.c} | 601 +--- MdePkg/Library/BaseLib/UnitTestHost.c | 140 + MdePkg/Library/BaseLib/UnitTestHost.h | 61 + .../Library/BaseLib/UnitTestHostBaseLib.inf | 216 ++ .../Library/BaseLib/UnitTestHostBaseLib.uni | 11 + MdePkg/Library/BaseLib/X64/GccInline.c | 1240 +------ .../X64/{GccInline.c => GccInlinePriv.c} | 572 +--- MdePkg/Library/BaseLib/X86UnitTestHost.c | 2969 +++++++++++++++++ MdePkg/MdePkg.dec | 3 +- MdePkg/MdePkg.dsc | 5 +- .../Include/HostTest/UnitTestHostBaseLib.h | 585 ++++ .../UnitTestDebugAssertLib.c | 49 + .../UnitTestDebugAssertLib.inf | 31 + .../UnitTestDebugAssertLib.uni | 11 + .../Library/UnitTestLib/Assert.c | 64 +- .../Library/UnitTestLib/RunTestsCmocka.c | 25 +- .../Sample/SampleUnitTest/SampleUnitTest.c | 109 + .../Test/UnitTestFrameworkPkgHostTest.dsc | 2 +- UnitTestFrameworkPkg/UnitTestFrameworkPkg.dsc | 1 + .../UnitTestFrameworkPkgHost.dsc.inc | 10 +- .../UnitTestFrameworkPkgTarget.dsc.inc | 10 +- 32 files changed, 4701 insertions(+), 3641 deletions(-) create mode 100644 MdePkg/Library/BaseCacheMaintenanceLibNull/BaseCacheMaintenanceLibNull.c create mode 100644 MdePkg/Library/BaseCacheMaintenanceLibNull/BaseCacheMaintenanceLibNull.inf create mode 100644 MdePkg/Library/BaseCacheMaintenanceLibNull/BaseCacheMaintenanceLibNull.uni create mode 100644 MdePkg/Library/BaseCpuLibNull/BaseCpuLibNull.c create mode 100644 MdePkg/Library/BaseCpuLibNull/BaseCpuLibNull.inf create mode 100644 MdePkg/Library/BaseCpuLibNull/BaseCpuLibNull.uni copy MdePkg/Library/BaseLib/Ia32/{GccInline.c => GccInlinePriv.c} (62%) create mode 100644 MdePkg/Library/BaseLib/UnitTestHost.c create mode 100644 MdePkg/Library/BaseLib/UnitTestHost.h create mode 100644 MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf create mode 100644 MdePkg/Library/BaseLib/UnitTestHostBaseLib.uni copy MdePkg/Library/BaseLib/X64/{GccInline.c => GccInlinePriv.c} (65%) create mode 100644 MdePkg/Library/BaseLib/X86UnitTestHost.c create mode 100644 MdePkg/Test/UnitTest/Include/HostTest/UnitTestHostBaseLib.h create mode 100644 UnitTestFrameworkPkg/Library/UnitTestDebugAssertLib/UnitTestDebugAssertLib.c create mode 100644 UnitTestFrameworkPkg/Library/UnitTestDebugAssertLib/UnitTestDebugAssertLib.inf create mode 100644 UnitTestFrameworkPkg/Library/UnitTestDebugAssertLib/UnitTestDebugAssertLib.uni -- 2.21.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#61243): https://edk2.groups.io/g/devel/message/61243 Mute This Topic: https://groups.io/mt/74885907/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-