From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.ispras.ru (mail.ispras.ru [83.149.199.45]) by mx.groups.io with SMTP id smtpd.web10.10208.1589302963217844896 for ; Tue, 12 May 2020 10:02:44 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: ispras.ru, ip: 83.149.199.45, mailfrom: cheptsov@ispras.ru) Received: from localhost.localdomain (unknown [77.232.9.83]) by mail.ispras.ru (Postfix) with ESMTPSA id F16B7CD469; Tue, 12 May 2020 20:02:38 +0300 (MSK) From: "Vitaly Cheptsov" To: devel@edk2.groups.io Cc: Michael D Kinney , Sean Brogan , Bret Barkelew Subject: [PATCH V5 02/27] UnitTestFrameworkPkg: Add support for DebugCommonLib Date: Tue, 12 May 2020 20:02:12 +0300 Message-Id: <20200512170237.19796-3-cheptsov@ispras.ru> X-Mailer: git-send-email 2.24.2 (Apple Git-127) In-Reply-To: <20200512170237.19796-1-cheptsov@ispras.ru> References: <20200512170237.19796-1-cheptsov@ispras.ru> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2054 CC: Michael D Kinney CC: Sean Brogan CC: Bret Barkelew Signed-off-by: Vitaly Cheptsov --- UnitTestFrameworkPkg/Library/Posix/DebugLibPosix/DebugLibPosix.c | 94 --= ------------------ UnitTestFrameworkPkg/Library/Posix/DebugLibPosix/DebugLibPosix.inf | 2 +- UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc | 1 + UnitTestFrameworkPkg/UnitTestFrameworkPkgTarget.dsc.inc | 1 + 4 files changed, 3 insertions(+), 95 deletions(-) diff --git a/UnitTestFrameworkPkg/Library/Posix/DebugLibPosix/DebugLibPosix= .c b/UnitTestFrameworkPkg/Library/Posix/DebugLibPosix/DebugLibPosix.c index 0daea00728..e490a53474 100644 --- a/UnitTestFrameworkPkg/Library/Posix/DebugLibPosix/DebugLibPosix.c +++ b/UnitTestFrameworkPkg/Library/Posix/DebugLibPosix/DebugLibPosix.c @@ -183,97 +183,3 @@ DebugClearMemory ( //=0D return SetMem (Buffer, Length, PcdGet8(PcdDebugClearMemoryValue));=0D }=0D -=0D -/**=0D - Returns TRUE if ASSERT() macros are enabled.=0D -=0D - This function returns TRUE if the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bi= t of=0D - PcdDebugPropertyMask is set. Otherwise FALSE is returned.=0D -=0D - @retval TRUE The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebug= PropertyMask is set.=0D - @retval FALSE The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebug= PropertyMask is clear.=0D -=0D -**/=0D -BOOLEAN=0D -EFIAPI=0D -DebugAssertEnabled (=0D - VOID=0D - )=0D -{=0D - return (BOOLEAN) ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_= ASSERT_ENABLED) !=3D 0);=0D -}=0D -=0D -/**=0D - Returns TRUE if DEBUG() macros are enabled.=0D -=0D - This function returns TRUE if the DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit= of=0D - PcdDebugPropertyMask is set. Otherwise FALSE is returned.=0D -=0D - @retval TRUE The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugP= ropertyMask is set.=0D - @retval FALSE The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugP= ropertyMask is clear.=0D -=0D -**/=0D -BOOLEAN=0D -EFIAPI=0D -DebugPrintEnabled (=0D - VOID=0D - )=0D -{=0D - return (BOOLEAN) ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_= PRINT_ENABLED) !=3D 0);=0D -}=0D -=0D -/**=0D - Returns TRUE if DEBUG_CODE() macros are enabled.=0D -=0D - This function returns TRUE if the DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit = of=0D - PcdDebugPropertyMask is set. Otherwise FALSE is returned.=0D -=0D - @retval TRUE The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugPr= opertyMask is set.=0D - @retval FALSE The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugPr= opertyMask is clear.=0D -=0D -**/=0D -BOOLEAN=0D -EFIAPI=0D -DebugCodeEnabled (=0D - VOID=0D - )=0D -{=0D - return (BOOLEAN) ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_= CODE_ENABLED) !=3D 0);=0D -}=0D -=0D -/**=0D - Returns TRUE if DEBUG_CLEAR_MEMORY() macro is enabled.=0D -=0D - This function returns TRUE if the DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bi= t of=0D - PcdDebugPropertyMask is set. Otherwise FALSE is returned.=0D -=0D - @retval TRUE The DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of PcdDebug= PropertyMask is set.=0D - @retval FALSE The DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of PcdDebug= PropertyMask is clear.=0D -=0D -**/=0D -BOOLEAN=0D -EFIAPI=0D -DebugClearMemoryEnabled (=0D - VOID=0D - )=0D -{=0D - return (BOOLEAN) ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_CLEAR_= MEMORY_ENABLED) !=3D 0);=0D -}=0D -=0D -/**=0D - Returns TRUE if any one of the bit is set both in ErrorLevel and PcdFixe= dDebugPrintErrorLevel.=0D -=0D - This function compares the bit mask of ErrorLevel and PcdFixedDebugPrint= ErrorLevel.=0D -=0D - @retval TRUE Current ErrorLevel is supported.=0D - @retval FALSE Current ErrorLevel is not supported.=0D -=0D -**/=0D -BOOLEAN=0D -EFIAPI=0D -DebugPrintLevelEnabled (=0D - IN CONST UINTN ErrorLevel=0D - )=0D -{=0D - return (BOOLEAN) ((ErrorLevel & PcdGet32(PcdFixedDebugPrintErrorLevel)) = !=3D 0);=0D -}=0D diff --git a/UnitTestFrameworkPkg/Library/Posix/DebugLibPosix/DebugLibPosix= .inf b/UnitTestFrameworkPkg/Library/Posix/DebugLibPosix/DebugLibPosix.inf index 5babbca3b0..9d6d9ab911 100644 --- a/UnitTestFrameworkPkg/Library/Posix/DebugLibPosix/DebugLibPosix.inf +++ b/UnitTestFrameworkPkg/Library/Posix/DebugLibPosix/DebugLibPosix.inf @@ -28,8 +28,8 @@ [LibraryClasses] PcdLib=0D PrintLib=0D BaseLib=0D + DebugCommonLib=0D =0D [Pcd]=0D gEfiMdePkgTokenSpaceGuid.PcdDebugClearMemoryValue ## SOMETIMES_CONSU= MES=0D gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask ## CONSUMES=0D - gEfiMdePkgTokenSpaceGuid.PcdFixedDebugPrintErrorLevel ## CONSUMES=0D diff --git a/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc b/UnitTe= stFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc index e954968efc..194e6ce108 100644 --- a/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc +++ b/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc @@ -12,6 +12,7 @@ [LibraryClasses.common.HOST_APPLICATION] CmockaLib|UnitTestFrameworkPkg/Library/CmockaLib/CmockaLib.inf=0D UnitTestLib|UnitTestFrameworkPkg/Library/UnitTestLib/UnitTestLibCmocka.i= nf=0D DebugLib|UnitTestFrameworkPkg/Library/Posix/DebugLibPosix/DebugLibPosix.= inf=0D + DebugCommonLib|MdePkg/Library/BaseDebugCommonLib/BaseDebugCommonLib.inf= =0D MemoryAllocationLib|UnitTestFrameworkPkg/Library/Posix/MemoryAllocationL= ibPosix/MemoryAllocationLibPosix.inf=0D =0D [BuildOptions]=0D diff --git a/UnitTestFrameworkPkg/UnitTestFrameworkPkgTarget.dsc.inc b/Unit= TestFrameworkPkg/UnitTestFrameworkPkgTarget.dsc.inc index c29b056fca..d1cb92aa0f 100644 --- a/UnitTestFrameworkPkg/UnitTestFrameworkPkgTarget.dsc.inc +++ b/UnitTestFrameworkPkg/UnitTestFrameworkPkgTarget.dsc.inc @@ -17,6 +17,7 @@ [LibraryClasses] BaseLib|MdePkg/Library/BaseLib/BaseLib.inf=0D BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf=0D DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf=0D + DebugCommonLib|MdePkg/Library/BaseDebugCommonLib/BaseDebugCommonLib.inf= =0D MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAll= ocationLib.inf=0D PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf=0D PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf=0D --=20 2.24.2 (Apple Git-127)