|
1 | 1 | #!/usr/bin/env bash |
2 | | -set -exo pipefail |
| 2 | +set -eo pipefail |
3 | 3 |
|
4 | | -if [[ $JOB_NAME == *"code-coverage" ]]; then |
5 | | - # Generate an XML report (Cobertura format) and a detailed HTML report using gcovr |
6 | | - # Note: trailing slashes are important in the paths below. Do not remove them! |
7 | | - gcovr --object-directory build \ |
8 | | - --filter tools/ \ |
9 | | - --exclude-throw-branches \ |
10 | | - --exclude-unreachable-branches \ |
11 | | - --cobertura build/coverage.xml \ |
12 | | - --html-details build/gcovr/ \ |
13 | | - --print-summary |
| 4 | +[[ $JOB_NAME == *code-coverage ]] || exit 0 |
14 | 5 |
|
15 | | - # Generate a detailed HTML report using lcov |
16 | | - lcov --quiet \ |
17 | | - --capture \ |
18 | | - --directory . \ |
19 | | - --exclude "$PWD/tests/*" \ |
20 | | - --no-external \ |
21 | | - --rc lcov_branch_coverage=1 \ |
22 | | - --output-file build/coverage.info |
| 6 | +export FORCE_COLOR=1 |
| 7 | +export UV_NO_MANAGED_PYTHON=1 |
23 | 8 |
|
24 | | - genhtml --branch-coverage \ |
25 | | - --demangle-cpp \ |
26 | | - --legend \ |
27 | | - --output-directory build/lcov \ |
28 | | - --title "ndn-tools unit tests" \ |
29 | | - build/coverage.info |
30 | | -fi |
| 9 | +set -x |
| 10 | + |
| 11 | +# Generate an XML report (Cobertura format) and a detailed HTML report using gcovr |
| 12 | +# Note: trailing slashes are important in the paths below. Do not remove them! |
| 13 | +uvx gcovr@5.2 \ |
| 14 | + --object-directory build \ |
| 15 | + --filter tools/ \ |
| 16 | + --exclude-throw-branches \ |
| 17 | + --exclude-unreachable-branches \ |
| 18 | + --cobertura build/coverage.xml \ |
| 19 | + --html-details build/gcovr/ \ |
| 20 | + --print-summary |
| 21 | + |
| 22 | +# Generate a detailed HTML report using lcov |
| 23 | +lcov --quiet \ |
| 24 | + --capture \ |
| 25 | + --directory . \ |
| 26 | + --exclude "$PWD/tests/*" \ |
| 27 | + --no-external \ |
| 28 | + --rc lcov_branch_coverage=1 \ |
| 29 | + --output-file build/coverage.info |
| 30 | + |
| 31 | +genhtml --branch-coverage \ |
| 32 | + --demangle-cpp \ |
| 33 | + --legend \ |
| 34 | + --output-directory build/lcov \ |
| 35 | + --title "ndn-tools unit tests" \ |
| 36 | + build/coverage.info |
0 commit comments