Zhiyi Zhang | 8617a79 | 2017-01-17 16:45:56 -0800 | [diff] [blame] | 1 | #!/usr/bin/env bash |
| 2 | set -e |
| 3 | |
| 4 | JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) |
| 5 | source "$JDIR"/util.sh |
| 6 | |
| 7 | set -x |
| 8 | |
| 9 | if [[ $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 |
| 20 | fi |