public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] UnitTestFrameworkPkg: Add code coverage support for GCC
@ 2022-09-13 13:24 Guo, Gua
  2022-09-13 13:28 ` Guo, Gua
  2022-09-13 15:10 ` Michael D Kinney
  0 siblings, 2 replies; 6+ messages in thread
From: Guo, Gua @ 2022-09-13 13:24 UTC (permalink / raw)
  To: devel
  Cc: Gua Guo, Michael D Kinney, Sean Brogan, Bret Barkelew,
	Michael Kubacki

From: Gua Guo <gua.guo@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@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Michael Kubacki <mikuback@linux.microsoft.com>
Signed-off-by: Gua Guo <gua.guo@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/MemoryAllocationLibPosix/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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-09-13 15:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-13 13:24 [PATCH] UnitTestFrameworkPkg: Add code coverage support for GCC Guo, Gua
2022-09-13 13:28 ` Guo, Gua
2022-09-13 15:11   ` Michael D Kinney
2022-09-13 15:19     ` Guo, Gua
2022-09-13 15:10 ` Michael D Kinney
2022-09-13 15:20   ` Guo, Gua

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox