Commit c422fd09 authored by Mohamed Fenjiro's avatar Mohamed Fenjiro Committed by Sébastien Blin

makefile: better coverage

Added precoverage step to ensure the percentage of lines covered are accurate

Added remove feature to better target files

Fixed coverage routine at the end

Removed make check in precoverage

Excluded /bin/* files

fixed output file

Change-Id: I7a4a4947d7a5491543e58b1c4b029db3cbcd0b7c
Reviewed-by: Sébastien Blin's avatarSébastien Blin <sebastien.blin@savoirfairelinux.com>
parent d18192bd
......@@ -16,16 +16,21 @@ EXTRA_DIST = m4/libtool.m4 \
contrib/bootstrap \
contrib/src
coverage:
$(AM_V_at)lcov --directory $(top_builddir) --capture --output-file dring-coverage.info
precoverage:
$(AM_V_at)lcov --no-external --capture --initial --directory $(top_builddir) --output-file dring-coverage-base.info
coverage: precoverage check
$(AM_V_at)lcov --no-external --capture --directory $(top_builddir) --output-file dring-coverage-tests.info
$(AM_V_at)lcov --add-tracefile dring-coverage-base.info --add-tracefile dring-coverage-tests.info --output-file dring-coverage.info
$(AM_V_at)lcov --remove dring-coverage.info '/contrib/*' '/usr/include/*' '/bin/*' --output-file dring-coverage-filtered.info
$(MKDIR_P) html-output
genhtml -o html-output dring-coverage.info
genhtml -o html-output dring-coverage-filtered.info
coverage-clean:
$(AM_V_at)lcov --directory $(top_builddir) --zerocounters
$(AM_V_at)rm -rf dring-coverage.info
$(AM_V_at)rm -rf dring-coverage-filtered.info
$(AM_V_at)rm -rf html-output
$(AM_V_at)find -name '*.gcda' -exec rm -f {} +
$(AM_V_at)find -name '*.gcno' -exec rm -f {} +
.PHONY: coverage coverage-clean
.PHONY: precoverage coverage coverage-clean
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment