summaryrefslogtreecommitdiffstats
path: root/UnitTestFrameworkPkg/Library
diff options
context:
space:
mode:
authorChris Johnson <chris.n.johnson@intel.com>2023-03-24 16:43:10 -0700
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2023-04-10 05:59:02 +0000
commitd0252b8fc1fe8b6489a4d0a25c29a5d3eaa95228 (patch)
treeeca7bd954a9a6b6d8a6be7e3e9bd808de1aae532 /UnitTestFrameworkPkg/Library
parentcaa389625faa7564d7c6e2105ae7947de2a23b07 (diff)
downloadedk2-d0252b8fc1fe8b6489a4d0a25c29a5d3eaa95228.tar.gz
edk2-d0252b8fc1fe8b6489a4d0a25c29a5d3eaa95228.tar.bz2
edk2-d0252b8fc1fe8b6489a4d0a25c29a5d3eaa95228.zip
UnitTestFrameworkPkg: Add gmock support to GoogleTestLib
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4389 * Add gmock support to GoogleTestLib * Add FunctionMockLib library class and library instance * Add GoogleTest extension to GoogleTestLib.h for CHAR16 type * Add GoogleTest extension to GoogleTestLib.h for buffer types * HOST_APPLICATION only supports IA32/X64 Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Michael Kubacki <mikuback@linux.microsoft.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Signed-off-by: Chris Johnson <chris.n.johnson@intel.com> Reviewed-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Oliver Smith-Denny <osde@linux.microsoft.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Diffstat (limited to 'UnitTestFrameworkPkg/Library')
-rw-r--r--UnitTestFrameworkPkg/Library/CmockaLib/CmockaLib.inf2
-rw-r--r--UnitTestFrameworkPkg/Library/FunctionMockLib/FunctionMockLib.c7
-rw-r--r--UnitTestFrameworkPkg/Library/FunctionMockLib/FunctionMockLib.inf31
-rw-r--r--UnitTestFrameworkPkg/Library/FunctionMockLib/FunctionMockLib.uni11
-rw-r--r--UnitTestFrameworkPkg/Library/GoogleTestLib/GoogleTestLib.inf21
-rw-r--r--UnitTestFrameworkPkg/Library/GoogleTestLib/GoogleTestLib.uni3
6 files changed, 59 insertions, 16 deletions
diff --git a/UnitTestFrameworkPkg/Library/CmockaLib/CmockaLib.inf b/UnitTestFrameworkPkg/Library/CmockaLib/CmockaLib.inf
index 052c7f5572..eeee6bc2b3 100644
--- a/UnitTestFrameworkPkg/Library/CmockaLib/CmockaLib.inf
+++ b/UnitTestFrameworkPkg/Library/CmockaLib/CmockaLib.inf
@@ -16,7 +16,7 @@
LIBRARY_CLASS = CmockaLib|HOST_APPLICATION
#
-# VALID_ARCHITECTURES = IA32 X64 ARM AARCH64
+# VALID_ARCHITECTURES = IA32 X64
#
[Sources]
diff --git a/UnitTestFrameworkPkg/Library/FunctionMockLib/FunctionMockLib.c b/UnitTestFrameworkPkg/Library/FunctionMockLib/FunctionMockLib.c
new file mode 100644
index 0000000000..b7bb23f186
--- /dev/null
+++ b/UnitTestFrameworkPkg/Library/FunctionMockLib/FunctionMockLib.c
@@ -0,0 +1,7 @@
+/** @file
+ Macro-only FunctionMockLib library instance with no services.
+
+ Copyright (c) 2023, Intel Corporation. All rights reserved.<BR>
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
diff --git a/UnitTestFrameworkPkg/Library/FunctionMockLib/FunctionMockLib.inf b/UnitTestFrameworkPkg/Library/FunctionMockLib/FunctionMockLib.inf
new file mode 100644
index 0000000000..44c5946be5
--- /dev/null
+++ b/UnitTestFrameworkPkg/Library/FunctionMockLib/FunctionMockLib.inf
@@ -0,0 +1,31 @@
+## @file
+# This module provides FunctionMockLib Library implementation.
+#
+# Copyright (c) 2023, Intel Corporation. All rights reserved.<BR>
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+[Defines]
+ INF_VERSION = 0x00010018
+ BASE_NAME = FunctionMockLib
+ MODULE_UNI_FILE = FunctionMockLib.uni
+ FILE_GUID = DF1CAF2F-D584-4EC1-9ABF-07E8B10AD560
+ MODULE_TYPE = HOST_APPLICATION
+ VERSION_STRING = 0.1
+ LIBRARY_CLASS = FunctionMockLib
+
+#
+# VALID_ARCHITECTURES = IA32 X64
+#
+
+[Sources]
+ FunctionMockLib.c
+
+[LibraryClasses]
+ GoogleTestLib
+ SubhookLib
+
+[Packages]
+ MdePkg/MdePkg.dec
+ UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec
diff --git a/UnitTestFrameworkPkg/Library/FunctionMockLib/FunctionMockLib.uni b/UnitTestFrameworkPkg/Library/FunctionMockLib/FunctionMockLib.uni
new file mode 100644
index 0000000000..13e5308ce0
--- /dev/null
+++ b/UnitTestFrameworkPkg/Library/FunctionMockLib/FunctionMockLib.uni
@@ -0,0 +1,11 @@
+// /** @file
+// This module provides FunctionMockLib Library implementation.
+//
+// Copyright (c) 2023, Intel Corporation. All rights reserved.<BR>
+// SPDX-License-Identifier: BSD-2-Clause-Patent
+//
+// **/
+
+#string STR_MODULE_ABSTRACT #language en-US "FunctionMockLib Library implementation"
+
+#string STR_MODULE_DESCRIPTION #language en-US "This module provides FunctionMockLib Library implementation."
diff --git a/UnitTestFrameworkPkg/Library/GoogleTestLib/GoogleTestLib.inf b/UnitTestFrameworkPkg/Library/GoogleTestLib/GoogleTestLib.inf
index 68db75d702..0104384953 100644
--- a/UnitTestFrameworkPkg/Library/GoogleTestLib/GoogleTestLib.inf
+++ b/UnitTestFrameworkPkg/Library/GoogleTestLib/GoogleTestLib.inf
@@ -7,30 +7,27 @@
##
[Defines]
- INF_VERSION = 0x00010005
+ INF_VERSION = 0x00010018
BASE_NAME = GoogleTestLib
MODULE_UNI_FILE = GoogleTestLib.uni
FILE_GUID = A90E4751-AD30-43CC-980B-01E356B49ADF
- MODULE_TYPE = BASE
+ MODULE_TYPE = HOST_APPLICATION
VERSION_STRING = 0.1
- LIBRARY_CLASS = GoogleTestLib|HOST_APPLICATION
+ LIBRARY_CLASS = GoogleTestLib
#
-# VALID_ARCHITECTURES = IA32 X64 ARM AARCH64
+# VALID_ARCHITECTURES = IA32 X64
#
[Sources]
googletest/googletest/src/gtest-all.cc
+ googletest/googlemock/src/gmock-all.cc
[Packages]
+ MdePkg/MdePkg.dec
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
+ MSFT:*_*_*_CC_FLAGS == /c /EHsc /Zi /Od
+ GCC:*_*_IA32_CC_FLAGS == -g -c -fshort-wchar -O0 -m32
+ GCC:*_*_X64_CC_FLAGS == -g -c -fshort-wchar -O0 -m64
diff --git a/UnitTestFrameworkPkg/Library/GoogleTestLib/GoogleTestLib.uni b/UnitTestFrameworkPkg/Library/GoogleTestLib/GoogleTestLib.uni
index 14c862a237..695588ce3f 100644
--- a/UnitTestFrameworkPkg/Library/GoogleTestLib/GoogleTestLib.uni
+++ b/UnitTestFrameworkPkg/Library/GoogleTestLib/GoogleTestLib.uni
@@ -1,10 +1,7 @@
// /** @file
// This module provides GoogleTest Library implementation.
//
-// This module provides GoogleTest Library implementation.
-//
// Copyright (c) 2022, Intel Corporation. All rights reserved.<BR>
-//
// SPDX-License-Identifier: BSD-2-Clause-Patent
//
// **/