ci: use gcovr 5.0 to generate code coverage reports
Change-Id: Ib7284d1616f9bce527aa98ccbb32e58d0bfa9dfb
This commit is contained in:
1 parent
4d030c3896
commit
2c61bad944
3 files changed
+20
-18
No files matched your search
@@ -2,6 +2,9 @@
|
||||
set -e
|
||||
source .jenkins.d/util.sh
|
||||
|
||||
if has Linux $NODE_LABELS; then
|
||||
export PATH="~/.local/bin${PATH:+:}${PATH}"
|
||||
fi
|
||||
export CACHE_DIR=${CACHE_DIR:-/tmp}
|
||||
export WAF_JOBS=${WAF_JOBS:-1}
|
||||
[[ $JOB_NAME == *"code-coverage" ]] && export DISABLE_ASAN=yes
|
||||
|
||||
@@ -38,7 +38,8 @@ elif has Ubuntu $NODE_LABELS; then
|
||||
|
||||
case $JOB_NAME in
|
||||
*code-coverage)
|
||||
sudo apt-get -qy install gcovr lcov
|
||||
sudo apt-get -qy install lcov python3-pip
|
||||
pip3 install --user --upgrade --upgrade-strategy=eager 'gcovr~=5.0'
|
||||
;;
|
||||
*Docs)
|
||||
sudo apt-get -qy install doxygen graphviz python3-pip
|
||||
|
||||
+15
-17
@@ -2,34 +2,32 @@
|
||||
set -ex
|
||||
|
||||
if [[ $JOB_NAME == *"code-coverage" ]]; then
|
||||
gcovr --object-directory=build \
|
||||
--output=build/coverage.xml \
|
||||
--exclude="$PWD/(tests|websocketpp)" \
|
||||
--root=. \
|
||||
--xml
|
||||
# Generate an XML report (Cobertura format) and a detailed HTML report using gcovr
|
||||
# Note: trailing slashes are important in the paths below. Do not remove them!
|
||||
gcovr -j$WAF_JOBS \
|
||||
--object-directory build \
|
||||
--exclude tests/ \
|
||||
--exclude websocketpp/ \
|
||||
--exclude-throw-branches \
|
||||
--exclude-unreachable-branches \
|
||||
--print-summary \
|
||||
--html-details build/gcovr/ \
|
||||
--xml build/coverage.xml
|
||||
|
||||
# Generate also a detailed HTML output, but using lcov (better results)
|
||||
# Generate a detailed HTML report using lcov
|
||||
lcov --quiet \
|
||||
--capture \
|
||||
--directory . \
|
||||
--exclude "$PWD/tests/*" \
|
||||
--exclude "$PWD/websocketpp/*" \
|
||||
--no-external \
|
||||
--rc lcov_branch_coverage=1 \
|
||||
--output-file build/coverage-with-tests-and-websocketpp.info
|
||||
|
||||
lcov --quiet \
|
||||
--remove build/coverage-with-tests-and-websocketpp.info "$PWD/websocketpp/*" \
|
||||
--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 \
|
||||
--legend \
|
||||
--output-directory build/coverage \
|
||||
--output-directory build/lcov \
|
||||
--title "NFD unit tests" \
|
||||
build/coverage.info
|
||||
fi
|
||||
Reference in new issue
Block a user