[Skiboot] [PATCH 6/6] gcov: properly handle gard and pflash code coverage
Stewart Smith
stewart at linux.vnet.ibm.com
Mon Jul 17 19:14:00 AEST 2017
We end up with a bit of a nasty hack to count the libflash symlinks
in gard and pflash as part of libflash code coverage, but it does
work and is unlikely to break anytime soon.
Signed-off-by: Stewart Smith <stewart at linux.vnet.ibm.com>
---
Makefile.main | 12 +++++++++++-
external/gard/test/Makefile.check | 8 +++++++-
2 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/Makefile.main b/Makefile.main
index 686a70a41677..ccc6ae6c7942 100644
--- a/Makefile.main
+++ b/Makefile.main
@@ -259,8 +259,18 @@ extract-gcov: extract-gcov.c
coverage-report: skiboot.info
genhtml --branch-coverage -q -o $@ $<
-skiboot.info: coverage
+# A rather nasty hack here that relies on the lcov file format
+external/pflash/pflash.info: coverage
+ (cd external/pflash; lcov -q -c -d . -o pflash.info --rc lcov_branch_coverage=1; sed -i -e 's%external/pflash/libflash%libflash%; s%external/pflash/ccan%ccan%' pflash.info)
+external/gard/gard.info: coverage
+ (cd external/gard; lcov -q -c -d . -o gard.info --rc lcov_branch_coverage=1; sed -i -e 's%external/gard/libflash%libflash%; s%external/gard/ccan%ccan%' gard.info)
+
+skiboot.info: coverage external/pflash/pflash.info external/gard/gard.info
lcov -q -c -d . $(LCOV_DIRS) -o $@ --rc lcov_branch_coverage=1
+ lcov -q -r $@ 'external/pflash/*' -o $@
+ lcov -q -r $@ 'external/gard/*' -o $@
+ lcov -q -a $@ -a external/pflash/pflash.info -o $@
+ lcov -q -a $@ -a external/gard/gard.info -o $@
lcov -q -r $@ $(LCOV_EXCLUDE) -o $@ --rc lcov_branch_coverage=1
tags:
diff --git a/external/gard/test/Makefile.check b/external/gard/test/Makefile.check
index 10cb7d10468c..593d0530ddb3 100644
--- a/external/gard/test/Makefile.check
+++ b/external/gard/test/Makefile.check
@@ -6,7 +6,7 @@ check: check-gard
#make clean before checking. If not, .o files for different
#architectures might be lying around and clean once done to
#avoid the opposite
-check-gard: gard-test-clean
+check-gard: gard-test-clean gard
$(call QTEST, RUN-TEST , make CC=$(HOSTCC) CROSS='' CROSS_COMPILE='' -C external/gard/ check, $@)
$(call QTEST, CLEANUP , make CC=$(HOSTCC) CROSS='' CROSS_COMPILE='' -C external/gard/ clean, $@)
@@ -14,6 +14,12 @@ check-gard: gard-test-clean
clean: gard-test-clean
+.PHONY: gard-coverage
+
+coverage: gard-coverage
+
+gard-coverage: check-gard
+
gard-test-clean:
$(call QTEST, CLEANUP , make -C external/gard clean, $@)
--
2.13.0
More information about the Skiboot
mailing list