Davide Pesavento | 6ebfd7c | 2017-08-26 17:52:54 -0400 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Davide Pesavento | f6be8e3 | 2020-04-30 16:06:03 -0400 | [diff] [blame] | 2 | set -ex |
Davide Pesavento | 6ebfd7c | 2017-08-26 17:52:54 -0400 | [diff] [blame] | 3 | |
| 4 | if [[ $JOB_NAME == *"code-coverage" ]]; then |
| 5 | lcov --quiet \ |
| 6 | --capture \ |
| 7 | --directory . \ |
| 8 | --no-external \ |
| 9 | --rc lcov_branch_coverage=1 \ |
| 10 | --output-file build/coverage-with-tests.info |
| 11 | |
| 12 | lcov --quiet \ |
| 13 | --remove build/coverage-with-tests.info "$PWD/tests/*" \ |
| 14 | --rc lcov_branch_coverage=1 \ |
| 15 | --output-file build/coverage.info |
| 16 | |
| 17 | genhtml --branch-coverage \ |
| 18 | --demangle-cpp \ |
Davide Pesavento | 6ebfd7c | 2017-08-26 17:52:54 -0400 | [diff] [blame] | 19 | --legend \ |
| 20 | --output-directory build/coverage \ |
| 21 | --title "NLSR unit tests" \ |
| 22 | build/coverage.info |
| 23 | fi |