blob: 46d3cf05490aa0367d0b2642ef2b44d2155ed8c2 [file] [log] [blame]
Alexander Afanasyeva87e0a82014-10-21 14:09:19 -04001#!/usr/bin/env bash
Alexander Afanasyev33ce4c32014-10-24 11:19:45 -07002set -e
Alexander Afanasyeva87e0a82014-10-21 14:09:19 -04003
Alexander Afanasyevb346ddb2015-06-03 00:52:03 -04004JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
5source "$JDIR"/util.sh
Alexander Afanasyeva87e0a82014-10-21 14:09:19 -04006
Davide Pesavento09348882016-09-17 02:39:44 +02007set -x
8
9if [[ $JOB_NAME == *"code-coverage" ]]; then
10 gcovr --object-directory=build \
11 --output=build/coverage.xml \
Davide Pesaventocf8a3682018-11-24 19:52:21 -050012 --exclude="$PWD/(examples|tests)" \
Davide Pesavento09348882016-09-17 02:39:44 +020013 --root=. \
14 --xml
Alexander Afanasyeve19643d2017-01-15 23:56:32 -080015
16 # Generate also a detailed HTML output, but using lcov (better results)
17 lcov --quiet \
Davide Pesaventoc44cc832017-04-03 22:11:48 -040018 --capture \
Alexander Afanasyeve19643d2017-01-15 23:56:32 -080019 --directory . \
Davide Pesaventoc44cc832017-04-03 22:11:48 -040020 --no-external \
Alexander Afanasyeve19643d2017-01-15 23:56:32 -080021 --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
Davide Pesaventoc44cc832017-04-03 22:11:48 -040029 genhtml --branch-coverage \
30 --demangle-cpp \
31 --frames \
32 --legend \
33 --output-directory build/coverage \
34 --title "ndn-cxx unit tests" \
35 build/coverage.info
Alexander Afanasyeva87e0a82014-10-21 14:09:19 -040036fi