summaryrefslogtreecommitdiffstats
path: root/python/Makefile
diff options
context:
space:
mode:
authorJohn Snow2021-09-15 18:29:55 +0200
committerJohn Snow2021-09-27 18:10:29 +0200
commita4ffaecd5726433f01b0ff857054acad9dc9df12 (patch)
treec5d4eb8b4e37d91df07d3550f5cdabba3d170061 /python/Makefile
parentpython/aqmp: add LineProtocol tests (diff)
downloadqemu-a4ffaecd5726433f01b0ff857054acad9dc9df12.tar.gz
qemu-a4ffaecd5726433f01b0ff857054acad9dc9df12.tar.xz
qemu-a4ffaecd5726433f01b0ff857054acad9dc9df12.zip
python/aqmp: Add Coverage.py support
I'm not exposing this via the Makefile help, it's not likely to be useful to passersby. Switch the avocado runner to the 'legacy' runner for now, as the new runner seems to obscure coverage reports, again. Usage is to enter your venv of choice and then: `make check-coverage && xdg-open htmlcov/index.html`. Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 20210915162955.333025-28-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
Diffstat (limited to 'python/Makefile')
-rw-r--r--python/Makefile9
1 files changed, 9 insertions, 0 deletions
diff --git a/python/Makefile b/python/Makefile
index fe27a3e12e..3334311362 100644
--- a/python/Makefile
+++ b/python/Makefile
@@ -92,6 +92,13 @@ check:
check-tox:
@tox $(QEMU_TOX_EXTRA_ARGS)
+.PHONY: check-coverage
+check-coverage:
+ @coverage run -m avocado --config avocado.cfg run tests/*.py
+ @coverage combine
+ @coverage html
+ @coverage report
+
.PHONY: clean
clean:
python3 setup.py clean --all
@@ -100,3 +107,5 @@ clean:
.PHONY: distclean
distclean: clean
rm -rf qemu.egg-info/ .venv/ .tox/ $(QEMU_VENV_DIR) dist/
+ rm -f .coverage .coverage.*
+ rm -rf htmlcov/