blob: 33238e2bea1836c4c28576d8d419f07da3e59e36 [file] [log] [blame]
Davide Pesavento6ebfd7c2017-08-26 17:52:54 -04001#!/usr/bin/env bash
Davide Pesaventof6be8e32020-04-30 16:06:03 -04002set -ex
Davide Pesavento6ebfd7c2017-08-26 17:52:54 -04003
4if [[ $JOB_NAME == *"code-coverage" ]]; then
Davide Pesaventoba8a4ed2021-10-13 21:28:43 -04005 # Generate a detailed HTML report using lcov
Davide Pesavento6ebfd7c2017-08-26 17:52:54 -04006 lcov --quiet \
7 --capture \
8 --directory . \
Davide Pesaventoba8a4ed2021-10-13 21:28:43 -04009 --exclude "$PWD/tests/*" \
Davide Pesavento6ebfd7c2017-08-26 17:52:54 -040010 --no-external \
11 --rc lcov_branch_coverage=1 \
Davide Pesavento6ebfd7c2017-08-26 17:52:54 -040012 --output-file build/coverage.info
13
14 genhtml --branch-coverage \
15 --demangle-cpp \
Davide Pesavento6ebfd7c2017-08-26 17:52:54 -040016 --legend \
Davide Pesaventoba8a4ed2021-10-13 21:28:43 -040017 --output-directory build/lcov \
Davide Pesavento6ebfd7c2017-08-26 17:52:54 -040018 --title "NLSR unit tests" \
19 build/coverage.info
20fi