6 python3 ./.gitlab-ci/fixup-cov-paths.py _coverage/*.lcov
8 for path in _coverage/*.lcov; do
9 # Remove coverage from generated code in the build directory
10 lcov --config-file .lcovrc -r "${path}" '*/_build/*' -o "$(pwd)/${path}"
11 # Remove any coverage from system files
12 lcov --config-file .lcovrc -e "${path}" "$(pwd)/*" -o "$(pwd)/${path}"
13 # Remove coverage from the fuzz tests, since they are run on a separate CI system
14 lcov --config-file .lcovrc -r "${path}" "*/fuzzing/*" -o "$(pwd)/${path}"
15 # Remove coverage from copylibs and subprojects
16 for lib in xdgmime libcharset gnulib; do
17 lcov --config-file .lcovrc -r "${path}" "*/${lib}/*" -o "$(pwd)/${path}"
20 # Convert to cobertura format for gitlab integration
21 cobertura_base="${path/.lcov}-cobertura"
22 cobertura_xml="${cobertura_base}.xml"
23 lcov_cobertura "${path}" --output "${cobertura_xml}"
24 mkdir -p "${cobertura_base}"
25 cobertura-split-by-package.py "${cobertura_xml}" "${cobertura_base}"
26 rm -f "${cobertura_xml}"
30 --ignore-errors=source \
31 --config-file .lcovrc \
42 <li><a href="coverage/index.html">Coverage</a></li>
48 # Print a handy link to the coverage report
49 echo "Coverage report at: https://${CI_PROJECT_NAMESPACE}.pages.gitlab.gnome.org/-/${CI_PROJECT_NAME}/-/jobs/${CI_BUILD_ID}/artifacts/_coverage/coverage/index.html"