blob: fadb5b1b99648afa58c2bcd7027d2c28712d76c2 [file] [log] [blame]
Davide Pesavento956ac312016-09-20 19:11:30 +02001#!/usr/bin/env bash
Davide Pesavento0771dc52025-03-25 01:15:30 -04002set -eo pipefail
Davide Pesavento956ac312016-09-20 19:11:30 +02003
Davide Pesavento0771dc52025-03-25 01:15:30 -04004[[ $JOB_NAME == *code-coverage ]] || exit 0
Eric Newberry716ab602016-12-29 21:49:57 -07005
Davide Pesavento0771dc52025-03-25 01:15:30 -04006export FORCE_COLOR=1
7export UV_NO_MANAGED_PYTHON=1
Eric Newberry716ab602016-12-29 21:49:57 -07008
Davide Pesavento0771dc52025-03-25 01:15:30 -04009set -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!
13uvx 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
23lcov --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
31genhtml --branch-coverage \
32 --demangle-cpp \
33 --legend \
34 --output-directory build/lcov \
35 --title "ndn-tools unit tests" \
36 build/coverage.info