blob: 0340a918e080577bcad3700d7810691798e7a4c6 [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 Pesavento8dce1942021-10-02 22:31:26 -04005 # Generate a detailed HTML report using lcov
Davide Pesavento87d4e202020-08-09 01:18:52 -04006 lcov --quiet \
7 --capture \
8 --directory . \
Davide Pesavento8dce1942021-10-02 22:31:26 -04009 --exclude "$PWD/tests/*" \
Davide Pesavento87d4e202020-08-09 01:18:52 -040010 --no-external \
11 --rc lcov_branch_coverage=1 \
Davide Pesavento87d4e202020-08-09 01:18:52 -040012 --output-file build/coverage.info
13
14 genhtml --branch-coverage \
15 --demangle-cpp \
16 --legend \
Davide Pesavento8dce1942021-10-02 22:31:26 -040017 --output-directory build/lcov \
Davide Pesavento87d4e202020-08-09 01:18:52 -040018 --title "PSync unit tests" \
19 build/coverage.info
20fi