Alexander Afanasyev | a9369b4 | 2017-01-11 11:58:00 -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 | |
Alexander Afanasyev | b403dbc | 2017-01-15 23:42:01 -0800 | [diff] [blame] | 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 |
| 18 | lcov -q -r build/coverage-with-tests.info "$PWD/tests/*" -o build/coverage.info |
| 19 | genhtml build/coverage.info --output-directory build/coverage --legend |
Alexander Afanasyev | a9369b4 | 2017-01-11 11:58:00 -0800 | [diff] [blame] | 20 | fi |