summaryrefslogtreecommitdiff
path: root/UnitTestFrameworkPkg/Library
diff options
context:
space:
mode:
authorChris Johnson <chris.n.johnson@intel.com>2022-12-21 11:56:07 -0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2023-04-10 05:59:02 +0000
commit0c6d851d258bac2df1e21e2670e8baca1bb37771 (patch)
tree374a61c0f259309a9c50ee2a2440d7d80890e19b /UnitTestFrameworkPkg/Library
parent6405cd03048c1850d5047bf66fefa04189a05c94 (diff)
downloadedk2-0c6d851d258bac2df1e21e2670e8baca1bb37771.zip
edk2-0c6d851d258bac2df1e21e2670e8baca1bb37771.tar.gz
edk2-0c6d851d258bac2df1e21e2670e8baca1bb37771.tar.bz2
UnitTestFrameworkPkg: Add subhook submodule required for gmock
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4389 Add subhook submodule that is required to hook internal functions when using gmock. https://github.com/Zeex/subhook Add SubhookLib library class and SubhookLib library instance. Include the SUBHOOK_STATIC define in the SubhookLib INF file so it builds as a static library. Also include the SUBHOOK_STATIC define in SubhookLib.h so all modules using SubhookLib properly link SubhookLib as a static library. Cc: Andrew Fish <afish@apple.com> Cc: Leif Lindholm <quic_llindhol@quicinc.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Michael Kubacki <mikuback@linux.microsoft.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Signed-off-by: Chris Johnson <chris.n.johnson@intel.com> Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.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/SubhookLib/SubhookLib.inf31
-rw-r--r--UnitTestFrameworkPkg/Library/SubhookLib/SubhookLib.uni11
m---------UnitTestFrameworkPkg/Library/SubhookLib/subhook0
3 files changed, 42 insertions, 0 deletions
diff --git a/UnitTestFrameworkPkg/Library/SubhookLib/SubhookLib.inf b/UnitTestFrameworkPkg/Library/SubhookLib/SubhookLib.inf
new file mode 100644
index 0000000..a67be89
--- /dev/null
+++ b/UnitTestFrameworkPkg/Library/SubhookLib/SubhookLib.inf
@@ -0,0 +1,31 @@
+## @file
+# This module provides Subhook Library implementation.
+#
+# Copyright (c) 2022, Intel Corporation. All rights reserved.<BR>
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+[Defines]
+ INF_VERSION = 0x00010018
+ BASE_NAME = SubhookLib
+ MODULE_UNI_FILE = SubhookLib.uni
+ FILE_GUID = 70E03378-E140-46A8-8E65-7719DA14A240
+ MODULE_TYPE = HOST_APPLICATION
+ VERSION_STRING = 0.1
+ LIBRARY_CLASS = SubhookLib
+
+#
+# VALID_ARCHITECTURES = IA32 X64
+#
+
+[Sources]
+ subhook/subhook.c
+
+[Packages]
+ UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec
+
+[BuildOptions]
+ MSFT:*_*_*_CC_FLAGS == /c /EHsc /Zi /DSUBHOOK_STATIC /Od
+ GCC:*_*_IA32_CC_FLAGS == -g -c -O0 -m32
+ GCC:*_*_X64_CC_FLAGS == -g -c -O0 -m64
diff --git a/UnitTestFrameworkPkg/Library/SubhookLib/SubhookLib.uni b/UnitTestFrameworkPkg/Library/SubhookLib/SubhookLib.uni
new file mode 100644
index 0000000..eb61f03
--- /dev/null
+++ b/UnitTestFrameworkPkg/Library/SubhookLib/SubhookLib.uni
@@ -0,0 +1,11 @@
+// /** @file
+// This module provides Subhook Library implementation.
+//
+// Copyright (c) 2022, Intel Corporation. All rights reserved.<BR>
+// SPDX-License-Identifier: BSD-2-Clause-Patent
+//
+// **/
+
+#string STR_MODULE_ABSTRACT #language en-US "Subhook Library implementation"
+
+#string STR_MODULE_DESCRIPTION #language en-US "This module provides Subhook Library implementation."
diff --git a/UnitTestFrameworkPkg/Library/SubhookLib/subhook b/UnitTestFrameworkPkg/Library/SubhookLib/subhook
new file mode 160000
+Subproject 83d4e1ebef3588fae48b69a7352cc21801cb70b