blob: e6867e6486d49966305809ea42567521547a2e6a [file] [log] [blame]
Alexander Afanasyeva87e0a82014-10-21 14:09:19 -04001#!/usr/bin/env bash
Davide Pesaventoee3ebeb2025-03-21 22:08:02 -04002set -eo pipefail
Davide Pesavento09348882016-09-17 02:39:44 +02003
Davide Pesaventoee3ebeb2025-03-21 22:08:02 -04004[[ $JOB_NAME == *code-coverage ]] || exit 0
Alexander Afanasyeve19643d2017-01-15 23:56:32 -08005
Davide Pesaventoee3ebeb2025-03-21 22:08:02 -04006export FORCE_COLOR=1
7export UV_NO_MANAGED_PYTHON=1
Alexander Afanasyeve19643d2017-01-15 23:56:32 -08008
Davide Pesaventoee3ebeb2025-03-21 22:08:02 -04009set -x
10
Davide Pesavento1c925242025-04-03 14:32:36 -040011# Generate a detailed HTML report and an XML report in Cobertura format using gcovr
Davide Pesaventoee3ebeb2025-03-21 22:08:02 -040012# Note: trailing slashes are important in the paths below. Do not remove them!
Davide Pesavento1c925242025-04-03 14:32:36 -040013uvx --from 'git+https://github.com/gcovr/gcovr@99b82e7' gcovr \
14 --decisions \
Davide Pesaventoee3ebeb2025-03-21 22:08:02 -040015 --filter ndn-cxx/ \
16 --exclude ndn-cxx/detail/nonstd/ \
17 --exclude-throw-branches \
18 --exclude-unreachable-branches \
19 --cobertura build/coverage.xml \
20 --html-details build/gcovr/ \
Davide Pesavento1c925242025-04-03 14:32:36 -040021 --txt-summary \
22 build
Davide Pesaventoee3ebeb2025-03-21 22:08:02 -040023
24# Generate a detailed HTML report using lcov
Davide Pesavento1c925242025-04-03 14:32:36 -040025lcov \
26 --quiet \
27 --capture \
28 --directory . \
29 --include "$PWD/ndn-cxx/*" \
30 --exclude "$PWD/ndn-cxx/detail/nonstd/*" \
31 --ignore-errors count,inconsistent \
32 --branch-coverage \
33 --rc no_exception_branch=1 \
34 --output-file build/coverage.info
Davide Pesaventoee3ebeb2025-03-21 22:08:02 -040035
Davide Pesavento1c925242025-04-03 14:32:36 -040036genhtml \
37 --quiet \
38 --branch-coverage \
39 --demangle-cpp \
40 --legend \
41 --missed \
42 --show-proportion \
43 --title "ndn-cxx $(cat VERSION.info)" \
44 --output-directory build/lcov \
45 build/coverage.info