blob: e629e83b21de7243871fbdbdbc86330bdf6929d4 [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 \
12 --exclude="$PWD/(tests)" \
13 --root=. \
14 --xml
15
16 # # Generate also a detailed HTML output, but using lcov (slower, but better results)
17 lcov -q -c -d . --no-external -o build/coverage-with-tests.info --rc lcov_branch_coverage=1
18 lcov -q -r build/coverage-with-tests.info "$PWD/tests/*" -o build/coverage.info --rc lcov_branch_coverage=1
19 genhtml build/coverage.info --output-directory build/coverage --legend --rc genhtml_branch_coverage=1
20fi