blob: 6941d692013055f71e050833e027f1b62083d456 [file] [log] [blame]
Davide Pesavento87d4e202020-08-09 01:18:52 -04001#!/usr/bin/env bash
2set -ex
3
4if [[ $JOB_NAME == *"code-coverage" ]]; then
Davide Pesaventof078fb52021-11-05 16:08:44 -04005 # 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 -j$WAF_JOBS \
8 --object-directory build \
9 --filter PSync/ \
10 --exclude-throw-branches \
11 --exclude-unreachable-branches \
12 --print-summary \
13 --html-details build/gcovr/ \
14 --xml build/coverage.xml
15
Davide Pesavento8dce1942021-10-02 22:31:26 -040016 # Generate a detailed HTML report using lcov
Davide Pesavento87d4e202020-08-09 01:18:52 -040017 lcov --quiet \
18 --capture \
19 --directory . \
Davide Pesavento8dce1942021-10-02 22:31:26 -040020 --exclude "$PWD/tests/*" \
Davide Pesavento87d4e202020-08-09 01:18:52 -040021 --no-external \
22 --rc lcov_branch_coverage=1 \
Davide Pesavento87d4e202020-08-09 01:18:52 -040023 --output-file build/coverage.info
24
25 genhtml --branch-coverage \
26 --demangle-cpp \
27 --legend \
Davide Pesavento8dce1942021-10-02 22:31:26 -040028 --output-directory build/lcov \
Davide Pesavento87d4e202020-08-09 01:18:52 -040029 --title "PSync unit tests" \
30 build/coverage.info
31fi