Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Makefile

    ra2b6523 rbde4f641  
    4343TESTSOUNDS := python/tests/sounds
    4444
     45LCOVOPTS += --rc lcov_branch_coverage=1
     46
    4547all: build
    4648
     
    235237        check_clean_python
    236238
     239coverage_cycle: coverage_zero_counters coverage_report
     240
     241coverage_zero_counters:
     242        lcov --zerocounters --directory .
     243
    237244coverage: export CFLAGS=--coverage
    238245coverage: export LDFLAGS=--coverage
     
    241248coverage: force_uninstall_python deps_python \
    242249        clean_python clean distclean build local_dylib
    243         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
    244254        pip install -v -e .
     255        # run tests, with python coverage
    245256        coverage run `which nose2`
    246         lcov --capture --no-external --directory . --output-file build/coverage_python.info
    247         lcov -a build/coverage_python.info -a build/coverage_lib.info -o build/coverage.info
    248 
     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 '*/ooura_fft8g*' \
     265                --output-file build/coverage_lib.info
     266
     267# make sure we don't build the doc, which builds a temporary python module
     268coverage_report: export WAFOPTS += --disable-docs
    249269coverage_report: coverage
    250         genhtml build/coverage.info --output-directory lcov_html
    251         mkdir -p gcovr_html/
    252         gcovr -r . --html --html-details \
    253                 --output gcovr_html/index.html \
    254                 --exclude ".*tests/.*" --exclude ".*examples/.*"
     270        # generate report with lcov's genhtml
     271        genhtml build/coverage_lib.info --output-directory build/coverage_c \
     272                --branch-coverage --highlight --legend
     273        # generate python report with coverage python package
    255274        coverage report
    256         coverage html
     275        coverage html -d build/coverage_python
     276        # show links to generated reports
     277        for i in $$(ls build/coverage_*/index.html); do echo file://$(PWD)/$$i; done
    257278
    258279sphinx: configure
Note: See TracChangeset for help on using the changeset viewer.