Skip to content
Snippets Groups Projects
Commit c422fd09 authored by Mohamed Fenjiro's avatar Mohamed Fenjiro Committed by Sébastien Blin
Browse files

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: default avatarSébastien Blin <sebastien.blin@savoirfairelinux.com>
parent d18192bd
No related branches found
No related tags found
No related merge requests found
...@@ -16,16 +16,21 @@ EXTRA_DIST = m4/libtool.m4 \ ...@@ -16,16 +16,21 @@ EXTRA_DIST = m4/libtool.m4 \
contrib/bootstrap \ contrib/bootstrap \
contrib/src contrib/src
coverage: precoverage:
$(AM_V_at)lcov --directory $(top_builddir) --capture --output-file dring-coverage.info $(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 $(MKDIR_P) html-output
genhtml -o html-output dring-coverage.info genhtml -o html-output dring-coverage-filtered.info
coverage-clean: coverage-clean:
$(AM_V_at)lcov --directory $(top_builddir) --zerocounters $(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)rm -rf html-output
$(AM_V_at)find -name '*.gcda' -exec rm -f {} + $(AM_V_at)find -name '*.gcda' -exec rm -f {} +
$(AM_V_at)find -name '*.gcno' -exec rm -f {} + $(AM_V_at)find -name '*.gcno' -exec rm -f {} +
.PHONY: coverage coverage-clean .PHONY: precoverage coverage coverage-clean
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment