summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorJeremy Bettis <jbettis@google.com>2021-03-17 16:48:56 -0600
committerCommit Bot <commit-bot@chromium.org>2021-03-18 21:39:05 +0000
commit965348c68ac1d2ae700b560c9c0118e96847b6ad (patch)
tree7c60322b5029989c6320c4ca423ebea6cc718eea /docs
parent30235cdfc9fba58a0bf67caa19f06caeef79a4db (diff)
downloadchrome-ec-965348c68ac1d2ae700b560c9c0118e96847b6ad.tar.gz
zephyr: Add util to normalize symlinks from lcov
Building a zephyr ztest with zmake (say that 3 times fast) creates many symlinks, and makes it hard to merge the coverage output. The util/normalize_symlinks.py tool takes a lcov info file as input and replaces symlinks with their actual paths in all SF: lines. BUG=b:183007888 TEST=Ran the commands in the md file. BRANCH=none Signed-off-by: Jeremy Bettis <jbettis@google.com> Change-Id: Ic8f9aedec30051d7474aa77ba2fb406e0746a719 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2770508 Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org> Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Tested-by: Jeremy Bettis <jbettis@chromium.org>
Diffstat (limited to 'docs')
-rw-r--r--docs/code_coverage.md13
1 files changed, 13 insertions, 0 deletions
diff --git a/docs/code_coverage.md b/docs/code_coverage.md
index 4d9dbb6948..3f87bf7848 100644
--- a/docs/code_coverage.md
+++ b/docs/code_coverage.md
@@ -33,3 +33,16 @@ function data mismatch at
These warnings can be ignored. (FYI, the "function data mismatch" warnings
appear to be caused in part by using relative paths instead of absolute paths.)
+
+## Zephyr ztest code coverage
+
+This needs some work, but you can generate coverage reports with these commands:
+
+```
+for i in zephyr/test/* ; do
+ builddir="build/ztest-coverage/$(basename $i)"
+ zmake configure --coverage --test -B ${builddir} $i
+ lcov --gcov-tool $HOME/trunk/src/platform/ec/util/llvm-gcov.sh -q -o - -c -d ${builddir} -t "$(basename $i)" --exclude '*/build-singleimage/zephyr/*/generated/*' | util/normalize_symlinks.py >${builddir}.info
+done
+genhtml -q -o build/ztest-coverage/coverage_rpt -t "Zephyr EC Unittest" -p /mnt/host/source/src -s build/ztest-coverage/*.info
+```