blob: 92a9cebbf5b28fb74a71141d8c4b4b5017c65db2 [file] [log] [blame]
Zhiyi Zhang8617a792017-01-17 16:45:56 -08001#!/usr/bin/env bash
2set -e
3
4JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
5source "$JDIR"/util.sh
6
7set -x
8
9if [[ $JOB_NAME == *"code-coverage" ]]; then
10 gcovr --object-directory=build \
11 --output=build/coverage.xml \
Davide Pesaventocf9ffe42018-01-21 22:21:53 -050012 --exclude="$PWD/tests" \
Zhiyi Zhang8617a792017-01-17 16:45:56 -080013 --root=. \
14 --xml
15
Davide Pesaventocf9ffe42018-01-21 22:21:53 -050016 # Generate also a detailed HTML output, but using lcov (better results)
17 lcov --quiet \
18 --capture \
19 --directory . \
20 --no-external \
21 --rc lcov_branch_coverage=1 \
22 --output-file build/coverage-with-tests.info
23
24 lcov --quiet \
25 --remove build/coverage-with-tests.info "$PWD/tests/*" \
26 --rc lcov_branch_coverage=1 \
27 --output-file build/coverage.info
28
29 genhtml --branch-coverage \
30 --demangle-cpp \
31 --frames \
32 --legend \
33 --output-directory build/coverage \
34 --title "ndncert unit tests" \
35 build/coverage.info
Zhiyi Zhang8617a792017-01-17 16:45:56 -080036fi