blob: 46a8e33ce8aa072e4255191b5276caca13be444a [file] [log] [blame]
Davide Pesavento4a315b32018-11-24 14:32:19 -05001#!/usr/bin/env bash
Davide Pesaventofee7ee32020-04-15 02:45:07 -04002set -ex
Davide Pesavento4a315b32018-11-24 14:32:19 -05003
4if [[ $JOB_NAME == *"code-coverage" ]]; then
5 gcovr --object-directory=build \
6 --output=build/coverage.xml \
7 --exclude="$PWD/tests" \
8 --root=. \
9 --xml
10
11 # Generate also a detailed HTML output, but using lcov (better results)
12 lcov --quiet \
13 --capture \
14 --directory . \
15 --no-external \
16 --rc lcov_branch_coverage=1 \
17 --output-file build/coverage-with-tests.info
18
19 lcov --quiet \
20 --remove build/coverage-with-tests.info "$PWD/tests/*" \
21 --rc lcov_branch_coverage=1 \
22 --output-file build/coverage.info
23
24 genhtml --branch-coverage \
25 --demangle-cpp \
Davide Pesavento4a315b32018-11-24 14:32:19 -050026 --legend \
27 --output-directory build/coverage \
28 --title "NDNS unit tests" \
29 build/coverage.info
30fi