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 |
Davide Pesavento | ba8a4ed | 2021-10-13 21:28:43 -0400 | [diff] [blame^] | 5 | # Generate a detailed HTML report using lcov |
Davide Pesavento | 6ebfd7c | 2017-08-26 17:52:54 -0400 | [diff] [blame] | 6 | lcov --quiet \ |
| 7 | --capture \ |
| 8 | --directory . \ |
Davide Pesavento | ba8a4ed | 2021-10-13 21:28:43 -0400 | [diff] [blame^] | 9 | --exclude "$PWD/tests/*" \ |
Davide Pesavento | 6ebfd7c | 2017-08-26 17:52:54 -0400 | [diff] [blame] | 10 | --no-external \ |
| 11 | --rc lcov_branch_coverage=1 \ |
Davide Pesavento | 6ebfd7c | 2017-08-26 17:52:54 -0400 | [diff] [blame] | 12 | --output-file build/coverage.info |
| 13 | |
| 14 | genhtml --branch-coverage \ |
| 15 | --demangle-cpp \ |
Davide Pesavento | 6ebfd7c | 2017-08-26 17:52:54 -0400 | [diff] [blame] | 16 | --legend \ |
Davide Pesavento | ba8a4ed | 2021-10-13 21:28:43 -0400 | [diff] [blame^] | 17 | --output-directory build/lcov \ |
Davide Pesavento | 6ebfd7c | 2017-08-26 17:52:54 -0400 | [diff] [blame] | 18 | --title "NLSR unit tests" \ |
| 19 | build/coverage.info |
| 20 | fi |