From 81b69f306fe801546786186e1e5ae5f79a2fde97 Mon Sep 17 00:00:00 2001 From: Michael D Kinney Date: Fri, 2 Feb 2024 17:28:31 -0800 Subject: UnitTestFrameworkPkg: Expand host-based exception handling and gcov REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4683 Update MSFT CC_FLAGS for host-based unit tests to use /EHs instead of /EHsc to support building C functions with SEH (Structured Exception Handling) enabled. This is required to build UnitTestDebugAssertLibHost.inf. Update GCC CC_FLAGS for host-based unit tests to use -fexceptions to support catching exceptions. Update GoogleTestLib.h to include Throws() APIs that enable unit tests to use EXPECT_THAT() to check for expected ASSERT() conditions for a specific ASSERT() expression. Update GCC CC_FLAGS to add --coverage for host-based builds for all GCC tool chains. Cc: Michael Kubacki Cc: Sean Brogan Signed-off-by: Michael D Kinney Reviewed-by: Michael Kubacki --- UnitTestFrameworkPkg/Library/GoogleTestLib/GoogleTestLib.inf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'UnitTestFrameworkPkg/Library') diff --git a/UnitTestFrameworkPkg/Library/GoogleTestLib/GoogleTestLib.inf b/UnitTestFrameworkPkg/Library/GoogleTestLib/GoogleTestLib.inf index 83ab9f9..0c52283 100644 --- a/UnitTestFrameworkPkg/Library/GoogleTestLib/GoogleTestLib.inf +++ b/UnitTestFrameworkPkg/Library/GoogleTestLib/GoogleTestLib.inf @@ -28,6 +28,6 @@ UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec [BuildOptions] - MSFT:*_*_*_CC_FLAGS == /c /EHsc /Zi /Od /MT - GCC:*_*_IA32_CC_FLAGS == -g -c -fshort-wchar -O0 -m32 - GCC:*_*_X64_CC_FLAGS == -g -c -fshort-wchar -O0 -m64 + MSFT:*_*_*_CC_FLAGS == /c /EHs /Zi /Od /MT + GCC:*_*_IA32_CC_FLAGS == -g -c -fshort-wchar -fexceptions -O0 -m32 -malign-double -fno-pie + GCC:*_*_X64_CC_FLAGS == -g -c -fshort-wchar -fexceptions -O0 -m64 -fno-pie "-DEFIAPI=__attribute__((ms_abi))" -- cgit v1.1