DATAROOTDIR?=$(PREFIX)/share
MANDIR?=$(DATAROOTDIR)/man
+# default python test command
+PYTEST?=pytest --verbose
+
SOX=sox
TESTSOUNDS := python/tests/sounds
test_python: export PYTHONPATH=$(PYDESTDIR)/$(LIBDIR)
test_python: local_dylib
# run test with installed package
- ./python/tests/run_all_tests --verbose
- # also run with nose, multiple processes
- nose2 -N 4
+ $(PYTEST)
clean_python:
./setup.py clean
uninstall_python \
check_clean_python
+coverage_cycle: coverage_zero_counters coverage_report
+
+coverage_zero_counters:
+ lcov --zerocounters --directory .
+
+coverage: export CFLAGS=--coverage
+coverage: export LDFLAGS=--coverage
+coverage: export PYTHONPATH=$(PWD)/python/lib
+coverage: export LD_LIBRARY_PATH=$(PWD)/build/src
+coverage: force_uninstall_python deps_python \
+ clean_python clean distclean build local_dylib
+ lcov --capture --no-external --directory . --output-file build/coverage_lib.info
+ pip install -v -e .
+ coverage run `which pytest`
+ lcov --capture --no-external --directory . --output-file build/coverage_python.info
+ lcov -a build/coverage_python.info -a build/coverage_lib.info -o build/coverage.info
+
+# make sure we don't build the doc, which builds a temporary python module
+coverage_report: export WAFOPTS += --disable-docs
+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)