From 2d144d7e147beddbba85cd04bd2093b544e5cf0a Mon Sep 17 00:00:00 2001 From: Michael D Kinney Date: Mon, 5 Feb 2024 14:59:42 -0800 Subject: UnitTestFrameworkPkg/UnitTestDebugAssertLib: Add GoogleTest support REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4683 Add an C++ implementation of UnitTestDebugAssert() API for host-based environments. GoogleTest based environments throw a C++ exception of type std::runtime_error when an ASSERT() is triggered with a description that contains the filename, line number, and the expression that triggered the ASSERT(). Cc: Michael Kubacki Cc: Sean Brogan Signed-off-by: Michael D Kinney Reviewed-by: Michael Kubacki --- .../UnitTestDebugAssertLibHost.inf | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 UnitTestFrameworkPkg/Library/UnitTestDebugAssertLib/UnitTestDebugAssertLibHost.inf (limited to 'UnitTestFrameworkPkg/Library/UnitTestDebugAssertLib/UnitTestDebugAssertLibHost.inf') diff --git a/UnitTestFrameworkPkg/Library/UnitTestDebugAssertLib/UnitTestDebugAssertLibHost.inf b/UnitTestFrameworkPkg/Library/UnitTestDebugAssertLib/UnitTestDebugAssertLibHost.inf new file mode 100644 index 0000000000..9a7673f179 --- /dev/null +++ b/UnitTestFrameworkPkg/Library/UnitTestDebugAssertLib/UnitTestDebugAssertLibHost.inf @@ -0,0 +1,36 @@ +## @file +# Unit Test Debug Assert Library for host-based environments +# +# Copyright (c) 2020, Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = UnitTestDebugAssertLibHost + MODULE_UNI_FILE = UnitTestDebugAssertLibHost.uni + FILE_GUID = F097D67C-0340-49C8-AB30-ABC1B7D1C8D2 + MODULE_TYPE = HOST_APPLICATION + VERSION_STRING = 1.0 + LIBRARY_CLASS = NULL + +# +# VALID_ARCHITECTURES = IA32 X64 ARM AARCH64 +# + +[Sources] + UnitTestDebugAssertLibHost.cpp + +[Packages] + MdePkg/MdePkg.dec + UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec + +[LibraryClasses] + BaseLib + UnitTestLib + +[BuildOptions] + 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.2.3