[edk2-devel] [EXTERNAL] [Patch v3 09/16] UnitTestFrameworkPkg: Change target mode DebugLib mapping

Bret Barkelew via groups.io bret.barkelew=microsoft.com at groups.io
Wed Jul 15 04:06:14 UTC 2020


Reviewed-by: Bret Barkelew <bret.barkelew at microsoft.com>


- Bret

________________________________
From: Michael D Kinney <michael.d.kinney at intel.com>
Sent: Friday, July 10, 2020 7:08:57 PM
To: devel at edk2.groups.io <devel at edk2.groups.io>
Cc: Sean Brogan <sean.brogan at microsoft.com>; Bret Barkelew <Bret.Barkelew at microsoft.com>; Yao, Jiewen <jiewen.yao at intel.com>
Subject: [EXTERNAL] [Patch v3 09/16] UnitTestFrameworkPkg: Change target mode DebugLib mapping

REF: https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2801&data=02%7C01%7CBret.Barkelew%40microsoft.com%7C51f924d3b7144be85fc608d8253f6879%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637300301550295393&sdata=mOv%2FyMpj14WmxCmpAdtexIJRxcyL9nkWJMrAxmqTV70%3D&reserved=0

The default DebugLib for target mode was DebugLibNull.  This
library instance disables all ASSERT() and DEBUG() macros
which removes the ability to write unit tests that check for
ASSERT() behaviors.

The DebugLib is changed to PeiDxeDebugLibReportStatusCode.inf
that guarantees that DEBUG() and ASSERT() macros are active.  The
default ReportStatusCodeLib is set to BaseReportStatusCodeLibNull.inf
so no messages are sent to any devices preserving the DebugLibNull
behavior.

A platform specific unit test can always override these mappings
with a platform specific DebugLib.

Cc: Sean Brogan <sean.brogan at microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew at microsoft.com>
Cc: Jiewen Yao <jiewen.yao at intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney at intel.com>
---
 UnitTestFrameworkPkg/UnitTestFrameworkPkgTarget.dsc.inc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/UnitTestFrameworkPkg/UnitTestFrameworkPkgTarget.dsc.inc b/UnitTestFrameworkPkg/UnitTestFrameworkPkgTarget.dsc.inc
index c29b056fca..0881278ab0 100644
--- a/UnitTestFrameworkPkg/UnitTestFrameworkPkgTarget.dsc.inc
+++ b/UnitTestFrameworkPkg/UnitTestFrameworkPkgTarget.dsc.inc
@@ -16,7 +16,9 @@ [LibraryClasses]

   BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
   BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
-  DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
+  DebugLib|MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf
+  ReportStatusCodeLib|MdePkg/Library/BaseReportStatusCodeLibNull/BaseReportStatusCodeLibNull.inf
+  DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
   MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
   PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
   PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf
--
2.21.0.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#62579): https://edk2.groups.io/g/devel/message/62579
Mute This Topic: https://groups.io/mt/75514379/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/edk2-devel-archive/attachments/20200715/e1a1c943/attachment.htm>


More information about the edk2-devel-archive mailing list