functions: revert the function init order to make pylint happy again. See #217
[pygobject.git] / .gitlab-ci / coverage-docker.sh
blob2a51d0361a4b48f27d421b05aa0cdf2b3611f26b
1 #!/bin/bash
3 set -e
5 python -m pip install coverage
7 # Make the Windows paths match our current layout
8 python ./.gitlab-ci/fixup-cov-paths.py coverage/.coverage* coverage/*.lcov
10 # Remove external headers (except gi tests)
11 for path in coverage/*.lcov; do
12 lcov --rc lcov_branch_coverage=1 -r "${path}" '/usr/include/*' -o "${path}"
13 lcov --rc lcov_branch_coverage=1 -r "${path}" '/home/*' -o "${path}"
14 done
16 python -m coverage combine coverage
17 python -m coverage html --ignore-errors -d coverage/report-python
18 genhtml --ignore-errors=source --rc lcov_branch_coverage=1 \
19 coverage/*.lcov -o coverage/report-c
21 cd coverage
22 rm -f .coverage*
23 rm -f *.lcov
25 ln -s report-python/index.html index-python.html
26 ln -s report-c/index.html index-c.html
28 cat >index.html <<EOL
29 <html>
30 <body>
31 <ul>
32 <li><a href="report-c/index.html">C Coverage</a></li>
33 <li><a href="report-python/index.html">Python Coverage</a></li>
34 </ul>
35 </body>
36 </html>
37 EOL