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
+ # capture coverage after running c tests
+ lcov $(LCOVOPTS) --capture --no-external --directory . \
+ --output-file build/coverage_lib.info
+ # build and test python
pip install -v -e .
- coverage run `which nose2`
+ # run tests, with python coverage
- 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
+ coverage run `which pytest`
+ # capture coverage again
+ lcov $(LCOVOPTS) --capture --no-external --directory . \
+ --output-file build/coverage_python.info
+ # merge both coverage info files
+ lcov $(LCOVOPTS) -a build/coverage_python.info -a build/coverage_lib.info \
+ --output-file build/coverage.info
+ # remove tests
+ lcov $(LCOVOPTS) --remove build/coverage.info '*/tests/*' '*/ooura_fft8g*' \
+ --output-file build/coverage_lib.info
# make sure we don't build the doc, which builds a temporary python module
coverage_report: export WAFOPTS += --disable-docs
Python tests
------------
- A number of python tests are provided. To run them, use [pytest] from the
- aubio source tree:
-A number of Python tests are provided in the `python tests`_. To run them,
-install `nose2`_ and run the script ``python/tests/run_all_tests``:
++A number of Python tests are provided in the `python/tests`_ folder. To run
++them, install `pytest`_ and run it from the aubio source directory:
+
+ .. code-block:: console
- $ pip install nose2
- $ ./python/tests/run_all_tests
++ $ pip install pytest
++ $ git clone https://git.aubio.org/aubio/aubio
+ $ cd aubio
+ $ pytest
- Each test script can also be called individually. For instance:
-
- $ ./python/tests/test_note2midi.py -v
-
- [pytest]: https://pytest.org
-.. _demo_filter.py: https://github.com/aubio/aubio/blob/master/python/demos/demo_filter.py
-.. _python tests: https://github.com/aubio/aubio/blob/master/python/tests
-.. _nose2: https://github.com/nose-devs/nose2
++.. _python/tests: https://github.com/aubio/aubio/blob/master/python/tests
++.. _pytest: https://pytest.org