Code Coverage¶
Tests code coverage HTML report.
builddir$ L=$(ls -1 ../tests/*.py)
builddir$ export PYTHONPATH=..
builddir$ python3 -m coverage erase
builddir$ for f in $L; do python3 -m coverage run --append --include='*/gtkdoc/*' $f; done
builddir$ python3 -m coverage report
Name Stmts Miss Cover
-----------------------------------------
gtkdoc/__init__.py 0 0 100%
gtkdoc/check.py 79 57 28%
gtkdoc/common.py 268 214 20%
gtkdoc/config.py 22 16 27%
gtkdoc/fixxref.py 224 204 9%
gtkdoc/highlight.py 19 5 74%
gtkdoc/md_to_db.py 431 144 67%
gtkdoc/mkdb.py 2662 2285 14%
gtkdoc/mkhtml2.py 1014 493 51%
gtkdoc/scan.py 581 131 77%
-----------------------------------------
TOTAL 5300 3549 33%
builddir$ rm -rf coverage/
builddir$ python3 -m coverage html --directory=coverage --title "GTK-Doc Tests Coverage"
Wrote HTML report to coverage/index.html
builddir$ unset PYTHONPATH
builddir$ D=$(dirname $(pwd))
builddir$ perl -i -pe "s@$D/@@g" coverage/*
builddir$ xdg-open coverage/index.html
builddir$ meson configure -Dcoverage=true
builddir$ meson gktdoc-coverage
builddir$
build$ make -C tests coverage
*** ERROR: python3-coverage is not available
make: *** [Makefile:1104: coverage] Error 1
$ sudo apt install python3-coverage
build$ make -C tests coverage
Wrote HTML report to htmlcov/index.html