Makefile: always generate coverage.info
[aubio.git] / Makefile
index 8dcbee8..7a9de9b 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -234,6 +234,24 @@ test_python_only_clean: test_python_only \
        uninstall_python \
        check_clean_python
 
+coverage: export CFLAGS=--coverage
+coverage: export LDFLAGS=--coverage
+coverage: export PYTHONPATH=$(PWD)/python/lib
+coverage: force_uninstall_python deps_python \
+       clean_python clean distclean
+       pip install -v -e .
+       coverage run `which nose2`
+       lcov --capture --no-external --directory . --output-file build/coverage.info
+
+coverage_report: coverage
+       genhtml build/coverage.info --output-directory lcov_html
+       mkdir -p gcovr_html/
+       gcovr -r . --html --html-details \
+               --output gcovr_html/index.html \
+               --exclude ".*tests/.*" --exclude ".*examples/.*"
+       coverage report
+       coverage html
+
 sphinx: configure
        $(WAFCMD) sphinx $(WAFOPTS)