From cef0c5c68427f4e93dc9c4135a8e60018f2307b5 Mon Sep 17 00:00:00 2001 From: Michael D Kinney Date: Mon, 20 Jun 2022 19:52:03 -0700 Subject: UnitTestFrameworkPkg: Add googletest submodule and GoogleTestLib REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4134 Add submodule for googletest and add GoogleTestLib that is required for GoogleTest based unit tests. Add GoogleTest documentation to Readme.md along with a port of the sample unit test to the GoogleTest style. A few typos in Readme.md are also fixed. Cc: Michael Kubacki Cc: Sean Brogan Cc: Andrew Fish Cc: Leif Lindholm Signed-off-by: Michael D Kinney Reviewed-by: Michael Kubacki Acked-by: Leif Lindholm --- .../Library/GoogleTestLib/GoogleTestLib.inf | 36 ++++++++++++++++++++++ .../Library/GoogleTestLib/GoogleTestLib.uni | 14 +++++++++ .../Library/GoogleTestLib/googletest | 1 + 3 files changed, 51 insertions(+) create mode 100644 UnitTestFrameworkPkg/Library/GoogleTestLib/GoogleTestLib.inf create mode 100644 UnitTestFrameworkPkg/Library/GoogleTestLib/GoogleTestLib.uni create mode 160000 UnitTestFrameworkPkg/Library/GoogleTestLib/googletest (limited to 'UnitTestFrameworkPkg/Library') diff --git a/UnitTestFrameworkPkg/Library/GoogleTestLib/GoogleTestLib.inf b/UnitTestFrameworkPkg/Library/GoogleTestLib/GoogleTestLib.inf new file mode 100644 index 0000000000..68db75d702 --- /dev/null +++ b/UnitTestFrameworkPkg/Library/GoogleTestLib/GoogleTestLib.inf @@ -0,0 +1,36 @@ +## @file +# This module provides GoogleTest Library implementation. +# +# Copyright (c) 2022, Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = GoogleTestLib + MODULE_UNI_FILE = GoogleTestLib.uni + FILE_GUID = A90E4751-AD30-43CC-980B-01E356B49ADF + MODULE_TYPE = BASE + VERSION_STRING = 0.1 + LIBRARY_CLASS = GoogleTestLib|HOST_APPLICATION + +# +# VALID_ARCHITECTURES = IA32 X64 ARM AARCH64 +# + +[Sources] + googletest/googletest/src/gtest-all.cc + +[Packages] + UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec + +[BuildOptions] + MSFT:*_*_*_CC_FLAGS == /c /EHsc /Zi + MSFT:NOOPT_*_*_CC_FLAGS = /Od + + GCC:*_*_*_CC_FLAGS == -g -c + + GCC:NOOPT_*_*_CC_FLAGS = -O0 + GCC:*_*_IA32_CC_FLAGS = -m32 + GCC:*_*_X64_CC_FLAGS = -m64 diff --git a/UnitTestFrameworkPkg/Library/GoogleTestLib/GoogleTestLib.uni b/UnitTestFrameworkPkg/Library/GoogleTestLib/GoogleTestLib.uni new file mode 100644 index 0000000000..14c862a237 --- /dev/null +++ b/UnitTestFrameworkPkg/Library/GoogleTestLib/GoogleTestLib.uni @@ -0,0 +1,14 @@ +// /** @file +// This module provides GoogleTest Library implementation. +// +// This module provides GoogleTest Library implementation. +// +// Copyright (c) 2022, Intel Corporation. All rights reserved.
+// +// SPDX-License-Identifier: BSD-2-Clause-Patent +// +// **/ + +#string STR_MODULE_ABSTRACT #language en-US "GoogleTest Library implementation" + +#string STR_MODULE_DESCRIPTION #language en-US "This module provides GoogleTest Library implementation." diff --git a/UnitTestFrameworkPkg/Library/GoogleTestLib/googletest b/UnitTestFrameworkPkg/Library/GoogleTestLib/googletest new file mode 160000 index 0000000000..86add13493 --- /dev/null +++ b/UnitTestFrameworkPkg/Library/GoogleTestLib/googletest @@ -0,0 +1 @@ +Subproject commit 86add13493e5c881d7e4ba77fb91c1f57752b3a4 -- cgit v1.2.3