Changeset 9617edd for Makefile


Ignore:
Timestamp:
Nov 22, 2018, 2:48:12 AM (10 months ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/constantq, feature/pitchshift, feature/pydocstrings, feature/timestretch, master
Children:
d252666
Parents:
59bad82
Message:

[make] add branch coverage, improve html report

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Makefile

    r59bad82 r9617edd  
    4343TESTSOUNDS := python/tests/sounds
    4444
     45LCOVOPTS += --rc lcov_branch_coverage=1
     46
    4547all: build
    4648
     
    246248coverage: force_uninstall_python deps_python \
    247249        clean_python clean distclean build local_dylib
    248         lcov --capture --no-external --directory . --output-file build/coverage_lib.info
     250        # capture coverage after running c tests
     251        lcov $(LCOVOPTS) --capture --no-external --directory . \
     252                --output-file build/coverage_lib.info
     253        # build and test python
    249254        pip install -v -e .
     255        # run tests, with python coverage
    250256        coverage run `which nose2`
    251         lcov --capture --no-external --directory . --output-file build/coverage_python.info
    252         lcov -a build/coverage_python.info -a build/coverage_lib.info -o build/coverage.info
     257        # capture coverage again
     258        lcov $(LCOVOPTS) --capture --no-external --directory . \
     259                --output-file build/coverage_python.info
     260        # merge both coverage info files
     261        lcov $(LCOVOPTS) -a build/coverage_python.info -a build/coverage_lib.info \
     262                --output-file build/coverage.info
     263        # remove tests
     264        lcov $(LCOVOPTS) --remove build/coverage.info '*/tests/*' '*/ooura_fft8g*' \
     265                --output-file build/coverage_lib.info
    253266
    254267# make sure we don't build the doc, which builds a temporary python module
    255268coverage_report: export WAFOPTS += --disable-docs
    256269coverage_report: coverage
    257         genhtml build/coverage.info --output-directory lcov_html
    258         mkdir -p gcovr_html/
    259         gcovr -r . --html --html-details \
    260                 --output gcovr_html/index.html \
    261                 --exclude ".*tests/.*" --exclude ".*examples/.*"
     270        # create coverage report dir
     271        mkdir -p build/coverage/
     272        # generate report with lcov's genhtml
     273        genhtml build/coverage_lib.info --output-directory build/coverage/lcov \
     274                --branch-coverage --highlight --legend
     275        # generate python report with coverage python package
    262276        coverage report
    263         coverage html
     277        coverage html -d build/coverage/coverage
     278        # show links to generated reports
     279        for i in $$(ls build/coverage/*/index.html); do echo file://$(PWD)/$$i; done
    264280
    265281sphinx: configure
Note: See TracChangeset for help on using the changeset viewer.