From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mx.groups.io with SMTP id smtpd.web12.7395.1592180361717892231 for ; Sun, 14 Jun 2020 17:19:21 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.151, mailfrom: michael.d.kinney@intel.com) IronPort-SDR: T7dWeeyemmW9h23M3S5VwGPxR9tdxo2gV7HJXGS2LVbsTQDIYLzHoj/Bo8MKYlkE/Ofssco6xG UTEPUNjP9YqQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jun 2020 17:19:20 -0700 IronPort-SDR: eePSmC98JC9SrEBiCzBQFcyUc0Bf5zAXU6vGg74cnsGKiF96C6zn/v9c4+06otoLeT3YKbkMN2 MGlWKTEMasbQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,513,1583222400"; d="scan'208";a="276370232" Received: from mdkinney-mobl2.amr.corp.intel.com ([10.252.142.246]) by orsmga006.jf.intel.com with ESMTP; 14 Jun 2020 17:19:20 -0700 From: "Michael D Kinney" To: devel@edk2.groups.io Cc: Liming Gao , Bob Feng , Sean Brogan , Bret Barkelew , Jiewen Yao Subject: [Patch 00/15] UnitTestFrameworkPkg: Enhancements and bug fixes Date: Sun, 14 Jun 2020 17:19:03 -0700 Message-Id: <20200615001918.22164-1-michael.d.kinney@intel.com> X-Mailer: git-send-email 2.21.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Cc: Bob Feng Cc: Sean Brogan Cc: Bret Barkelew Cc: Jiewen Yao Signed-off-by: Michael D Kinney 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