blob: 50802668f4830b0f27804d3c37746fddfe39e908 [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 \
12 --filter="$PWD/src" \
13 --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 \
18 --capture --no-external \
19 --directory . \
20 --rc lcov_branch_coverage=1 \
21 --output-file build/coverage-with-tests.info
22
23 lcov --quiet \
24 --remove build/coverage-with-tests.info "$PWD/tests/*" \
25 --rc lcov_branch_coverage=1 \
26 --output-file build/coverage.info
27
28 genhtml --legend \
29 --rc genhtml_branch_coverage=1 \
30 build/coverage.info \
31 --output-directory build/coverage
Alexander Afanasyeva87e0a82014-10-21 14:09:19 -040032fi