2018-04-27 17:04:52 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
# Fixup Windows paths
|
|
|
|
python3 ./.gitlab-ci/fixup-cov-paths.py _coverage/*.lcov
|
|
|
|
|
|
|
|
for path in _coverage/*.lcov; do
|
2018-07-06 09:33:22 +02:00
|
|
|
# Remove coverage from generated code in the build directory
|
2018-10-03 15:47:26 +02:00
|
|
|
lcov --config-file .gitlab-ci/lcovrc -r "${path}" '*/_build/*' -o "$(pwd)/${path}"
|
2018-07-06 09:33:22 +02:00
|
|
|
# Remove any coverage from system files
|
2018-10-03 15:47:26 +02:00
|
|
|
lcov --config-file .gitlab-ci/lcovrc -e "${path}" "$(pwd)/*" -o "$(pwd)/${path}"
|
2018-04-27 17:04:52 +02:00
|
|
|
done
|
|
|
|
|
|
|
|
genhtml \
|
|
|
|
--ignore-errors=source \
|
2018-10-03 15:47:26 +02:00
|
|
|
--config-file .gitlab-ci/lcovrc \
|
2018-04-27 17:04:52 +02:00
|
|
|
_coverage/*.lcov \
|
|
|
|
-o _coverage/coverage
|
|
|
|
|
|
|
|
cd _coverage
|
2020-02-25 12:46:11 +01:00
|
|
|
rm -f ./*.lcov
|
2018-04-27 17:04:52 +02:00
|
|
|
|
|
|
|
cat >index.html <<EOL
|
|
|
|
<html>
|
|
|
|
<body>
|
|
|
|
<ul>
|
|
|
|
<li><a href="coverage/index.html">Coverage</a></li>
|
|
|
|
</ul>
|
|
|
|
</body>
|
|
|
|
</html>
|
|
|
|
EOL
|
2022-02-01 12:08:22 +01:00
|
|
|
|
|
|
|
# Print a handy link to the coverage report
|
|
|
|
echo "Coverage report at: https://${CI_PROJECT_NAMESPACE}.pages.gitlab.gnome.org/-/${CI_PROJECT_NAME}/-/jobs/${CI_BUILD_ID}/artifacts/_coverage/coverage/index.html"
|