summaryrefslogtreecommitdiff
path: root/Makefile.rules
diff options
context:
space:
mode:
authorPaul Fagerburg <pfagerburg@google.com>2021-06-09 20:21:33 -0600
committerCommit Bot <commit-bot@chromium.org>2021-06-10 05:16:28 +0000
commitd8e89fc1cc4513a46931724e828efaa8029311fa (patch)
treeb349d4246d5cfe7a7341abeae8629b16f81a46eb /Makefile.rules
parenta1a7979aaf4187acafbb7a6cfae3166274ec0645 (diff)
downloadchrome-ec-d8e89fc1cc4513a46931724e828efaa8029311fa.tar.gz
Makefile.rules: make LCOV paths relative to repo
The code coverage plugin requires that the paths are relative to the repo, so we need to strip off the path above the repo's top level. BRANCH=None BUG=b:156895937 TEST=`make coverage ; grep SF: build/coverage/lcov.info` and observe that the source paths are now relative to the repo, instead of starting with /mnt/source Signed-off-by: Paul Fagerburg <pfagerburg@google.com> Change-Id: Iba86badeefd7359b72cb7e04cf97b0e51eed6789 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2950569 Tested-by: Paul Fagerburg <pfagerburg@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Paul Fagerburg <pfagerburg@chromium.org>
Diffstat (limited to 'Makefile.rules')
-rw-r--r--Makefile.rules3
1 files changed, 3 insertions, 0 deletions
diff --git a/Makefile.rules b/Makefile.rules
index 01913a82ea..b6a631bec9 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -414,6 +414,8 @@ cmd_lcov-initial=flock /tmp/ec-lcov-lock -c "lcov --gcov-tool \
cmd_merge_cov=lcov -o build/coverage/lcov.info $(foreach info,$^,-a ${info})
cmd_report_cov=genhtml -q -o build/coverage/coverage_rpt -t \
"EC Unittest "$(bldversion) -s $^
+cmd_strip_lcov=sed -i build/coverage/lcov.info \
+ -e 's/\/mnt\/host\/source\/src\/platform\/ec\///'
# Unless V is set to 0 we always want the 'size:' target to report its output,
# there is no point in generating a short form command trace when calculating
@@ -461,6 +463,7 @@ coverage: TEST_FLAG=TEST_COVERAGE=y
coverage: $(cov-test-targets)
$(call quiet,merge_cov,MERGE )
$(call quiet,report_cov,REPORT )
+ $(call quiet,strip_lcov,STRIP )
$(out)/libec.a: $(ro-objs)
$(call quiet,libec,BUILD )