Changeset View
Changeset View
Standalone View
Standalone View
Makefile.am
Show First 20 Lines • Show All 67 Lines • ▼ Show 20 Lines | if test -d $(top_srcdir)/.git; then \ | ||||
rm -f $(distdir)/ChangeLog; \ | rm -f $(distdir)/ChangeLog; \ | ||||
mv $(distdir)/cl-t $(distdir)/ChangeLog; \ | mv $(distdir)/cl-t $(distdir)/ChangeLog; \ | ||||
fi | fi | ||||
stowinstall: | stowinstall: | ||||
$(MAKE) $(AM_MAKEFLAGS) install prefix=/usr/local/stow/libksba | $(MAKE) $(AM_MAKEFLAGS) install prefix=/usr/local/stow/libksba | ||||
# Coverage targets | |||||
werner: This looks like a lot of boilerplate code. It is okay to test this in libksba but when we… | |||||
kaiAuthorUnsubmitted Done Inline ActionsI'll try to integrate that into gcov.m4. The problem is that the boilerplate is project specific b/c it's excluding things like tests and utility functions from the coverage. kai: I'll try to integrate that into gcov.m4. The problem is that the boilerplate is project… | |||||
if HAVE_GCOV | |||||
.PHONY: clean-gcda | |||||
clean-gcda: | |||||
@echo Removing old coverage results | |||||
-find -name '*.gcda' -print | xargs -r rm | |||||
-find -name '*.gcno' -print | xargs -r rm | |||||
.PHONY: coverage-html generate-coverage-html clean-coverage-html | |||||
#coverage-html: clean-gcda | |||||
coverage-html: | |||||
$(MAKE) $(AM_MAKEFLAGS) -k check | |||||
$(MAKE) $(AM_MAKEFLAGS) generate-coverage-html | |||||
generate-coverage-html: | |||||
@echo Collecting coverage data with lcov | |||||
$(LCOV) --gcov-tool $(GCOV) -b src --directory $(builddir)/src --capture --output-file coverage.info.src --no-checksum --compat-libtool --rc lcov_branch_coverage=1 | |||||
$(LCOV) --gcov-tool $(GCOV) -b tests --directory $(builddir)/tests --capture --output-file coverage.info.tests --no-checksum --compat-libtool --rc lcov_branch_coverage=1 | |||||
$(LCOV) -a coverage.info.src -a coverage.info.tests --output-file coverage.info --no-checksum --rc lcov_branch_coverage=1 | |||||
$(LCOV) --remove coverage.info "/usr*" -o coverage.info --rc lcov_branch_coverage=1 | |||||
$(LCOV) --remove coverage.info "/opt*" -o coverage.info --rc lcov_branch_coverage=1 | |||||
$(LCOV) --remove coverage.info "*/tests/*" -o coverage.info --rc lcov_branch_coverage=1 | |||||
LANG=C $(GENHTML) --prefix $(builddir)/src --output-directory coveragereport --title "Code Coverage" --legend --show-details coverage.info --rc lcov_branch_coverage=1 | |||||
clean-coverage-html: clean-gcda | |||||
-$(LCOV) --directory $(builddir)/src -z | |||||
-$(LCOV) --directory $(builddir)/test -z | |||||
-rm -rf coverage.info coveragereport | |||||
clean-local: clean-coverage-html | |||||
endif # HAVE_GCOV |
This looks like a lot of boilerplate code. It is okay to test this in libksba but when we come to the point touse this with more packages I would suggest to do this as a shell script. Our ./autogen.sh is already the common denominator of all configure stuff. Adding a mode there to enable coverage reports and to use it as a helper script for Makefiles (iff needed) will make things much easier to maintain and keep consistend between packages. The generic autogen.sh source is in libgpg-error.