ci: add generation of HTML coverage report using lcov

Copied from ndn-cxx

Change-Id: Ie8c08a570afe67c9eb232b37ad0038566ad49572
This commit is contained in:
Davide Pesavento committed 2017-05-03 01:14:32 -04:00
1 parent 1cce2a3014
commit 8d61c037a7
2 files changed
+26

No files matched your search

+5
View File
@@ -18,4 +18,9 @@ if has Ubuntu $NODE_LABELS; then
sudo apt-get -qq install build-essential pkg-config libboost-all-dev \
libcrypto++-dev libsqlite3-dev libssl-dev \
libpcap-dev
if [[ $JOB_NAME == *"code-coverage" ]]; then
sudo apt-get -qq install lcov libgd-perl python-setuptools
sudo easy_install --upgrade gcovr
fi
fi
+21
View File
@@ -12,4 +12,25 @@ if [[ $JOB_NAME == *"code-coverage" ]]; then
--exclude="$PWD/(tests|websocketpp)" \
--root=. \
--xml
# Generate also a detailed HTML output, but using lcov (better results)
lcov --quiet \
--capture \
--directory . \
--no-external \
--rc lcov_branch_coverage=1 \
--output-file build/coverage-with-tests.info
lcov --quiet \
--remove build/coverage-with-tests.info "$PWD/tests/*" \
--rc lcov_branch_coverage=1 \
--output-file build/coverage.info
genhtml --branch-coverage \
--demangle-cpp \
--frames \
--legend \
--output-directory build/coverage \
--title "NFD unit tests" \
build/coverage.info
fi