blob: 7637b61a38e0dd6b9526817a8a3591de751e8e73 [file] [log] [blame]
Davide Pesavento956ac312016-09-20 19:11:30 +02001#!/usr/bin/env bash
2set -e
3
4JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
5source "$JDIR"/util.sh
6
7set -x
8
Eric Newberry716ab602016-12-29 21:49:57 -07009if [[ $JOB_NAME == *"code-coverage" ]]; then
Davide Pesavento956ac312016-09-20 19:11:30 +020010 gcovr --object-directory=build \
11 --output=build/coverage.xml \
Eric Newberry716ab602016-12-29 21:49:57 -070012 --exclude="$PWD/tests" \
Davide Pesavento956ac312016-09-20 19:11:30 +020013 --root=. \
14 --xml
Eric Newberry716ab602016-12-29 21:49:57 -070015
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
Davide Pesavento956ac312016-09-20 19:11:30 +020032fi