[edk2-devel] [PATCH] UnitTestFrameworkPkg: Add code coverage support for GCC
Guo, Gua
gua.guo at intel.com
Tue Sep 13 15:20:15 UTC 2022
Sure, thanks for replying quickly, let me update readme.md file in my next patch.
-----Original Message-----
From: Kinney, Michael D <michael.d.kinney at intel.com>
Sent: Tuesday, September 13, 2022 11:10 PM
To: Guo, Gua <gua.guo at intel.com>; devel at edk2.groups.io; Kinney, Michael D <michael.d.kinney at intel.com>
Cc: Sean Brogan <sean.brogan at microsoft.com>; Barkelew, Bret <bret.barkelew at microsoft.com>; Michael Kubacki <mikuback at linux.microsoft.com>
Subject: RE: [PATCH] UnitTestFrameworkPkg: Add code coverage support for GCC
Hi,
This change looks safe because it is scoped to host-based unit tests that include this file in the DSC file that builds host-based tests.
Can you also update the UnitTestFrameworkPkg/ReadMe.md to describe how a developer can enable/use the code coverage feature for GCC host-based tests?
Mike
> -----Original Message-----
> From: Guo, Gua <gua.guo at intel.com>
> Sent: Tuesday, September 13, 2022 6:24 AM
> To: devel at edk2.groups.io
> Cc: Guo, Gua <gua.guo at intel.com>; Kinney, Michael D
> <michael.d.kinney at intel.com>; Sean Brogan <sean.brogan at microsoft.com>;
> Barkelew, Bret <bret.barkelew at microsoft.com>; Michael Kubacki
> <mikuback at linux.microsoft.com>
> Subject: [PATCH] UnitTestFrameworkPkg: Add code coverage support for
> GCC
>
> From: Gua Guo <gua.guo at intel.com>
>
> In order to collect code coverage after running executable file,
> generate *.gcda and *.gcno file that require by lcov tool to generate
> code coverage report.
>
> Cc: Michael D Kinney <michael.d.kinney at intel.com>
> Cc: Sean Brogan <sean.brogan at microsoft.com>
> Cc: Bret Barkelew <Bret.Barkelew at microsoft.com>
> Cc: Michael Kubacki <mikuback at linux.microsoft.com>
> Signed-off-by: Gua Guo <gua.guo at intel.com>
> ---
> UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc
> b/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc
> index 4dd8d4ac67..8623aecb33 100644
> --- a/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc
> +++ b/UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc
> @@ -19,7 +19,7 @@
>
> MemoryAllocationLib|UnitTestFrameworkPkg/Library/Posix/MemoryAllocatio
> nLibPosix/MemoryAllocationLibPosix.inf
>
>
>
> [BuildOptions]
>
> - GCC:*_*_*_CC_FLAGS = -fno-pie
>
> + GCC:*_*_*_CC_FLAGS = -fno-pie -ftest-coverage -fprofile-arcs
>
> !ifdef $(UNIT_TESTING_DEBUG)
>
> MSFT:*_*_*_CC_FLAGS = -D UNIT_TESTING_DEBUG=1
>
> GCC:*_*_*_CC_FLAGS = -D UNIT_TESTING_DEBUG=1
>
> --
> 2.31.1.windows.1
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#93719): https://edk2.groups.io/g/devel/message/93719
Mute This Topic: https://groups.io/mt/93654981/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-
More information about the edk2-devel-archive
mailing list