| 1 | #! /bin/sh |
| 2 | set -e |
| 3 | |
| 4 | case "$CC" in |
| 5 | (*clang*) |
| 6 | GCOV=$(pwd)/build-aux/ci/clang-gcov-wrapper ;; |
| 7 | (*) |
| 8 | GCOV=gcov ;; |
| 9 | esac |
| 10 | |
| 11 | unpruned=$(mktemp --tmpdir all-coverage.XXXXXXXXXX.info) |
| 12 | trap 'rm -f "'"$unpruned"'"' 0 |
| 13 | |
| 14 | set -x |
| 15 | # Merge all of the gcov output into one overview file using lcov, |
| 16 | # then prune data for the tests themselves, and for system libraries. |
| 17 | |
| 18 | lcov --gcov-tool "$GCOV" --rc branch_coverage=1 \ |
| 19 | --directory . --output-file "$unpruned" \ |
| 20 | --capture |
| 21 | |
| 22 | lcov --gcov-tool "$GCOV" --rc branch_coverage=1 \ |
| 23 | --directory . --output-file "$1" --ignore-errors unused \ |
| 24 | --remove "$unpruned" '/usr/*' '*test*' '*gen-des-tables*' |