coverage-docker.sh 694 Bytes
Newer Older
1 2 3 4 5 6 7 8
#!/bin/bash

set -e

# Fixup Windows paths
python3 ./.gitlab-ci/fixup-cov-paths.py _coverage/*.lcov

for path in _coverage/*.lcov; do
9
    # Remove coverage from generated code in the build directory
10
    lcov --config-file .gitlab-ci/lcovrc -r "${path}" '*/_build/*' -o "$(pwd)/${path}"
11
    # Remove any coverage from system files
12
    lcov --config-file .gitlab-ci/lcovrc -e "${path}" "$(pwd)/*" -o "$(pwd)/${path}"
13 14 15 16
done

genhtml \
    --ignore-errors=source \
17
    --config-file .gitlab-ci/lcovrc \
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
    _coverage/*.lcov \
    -o _coverage/coverage

cd _coverage
rm -f *.lcov

cat >index.html <<EOL
<html>
<body>
<ul>
<li><a href="coverage/index.html">Coverage</a></li>
</ul>
</body>
</html>
EOL