diff options
Diffstat (limited to 'Makefile.am')
-rw-r--r-- | Makefile.am | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am index 3c906578..78916123 100644 --- a/Makefile.am +++ b/Makefile.am @@ -74,3 +74,32 @@ dist-hook: # TODO remove this once automake vs. AC_CONFIG_LINKS issue is fixed. distclean-local: if test x"$(VPATH)" != x ; then rm -f GNUmakefile ; fi + +# Perl coverage statistics. +PERL_COVERAGE_DB = `pwd`/cover_db +PERL_COVERAGE_FLAGS = -MDevel::Cover=-db,$(PERL_COVERAGE_DB),-silent,on,-summary,off +PERL_COVER = cover + +check-coverage-run: all + $(mkinstalldirs) $(PERL_COVERAGE_DB) + PERL5OPT="$(PERL_COVERAGE_FLAGS)"; export PERL5OPT; \ + $(MAKE) $(AM_MAKEFLAGS) check + +check-coverage-report: + @if test ! -d $(PERL_COVERAGE_DB); then \ + echo "No coverage database found in \`$(PERL_COVERAGE_DB)'." >&2; \ + echo "Please run \`make check-coverage' first" >&2; \ + exit 1; \ + fi + $(PERL_COVER) $(PERL_COVERAGE_DB) $(PERL_COVER_FLAGS) + +# We don't use direct dependencies here because we'd like to be able +# to invoke the report even after interrupted check-coverage. +check-coverage: check-coverage-run + $(MAKE) $(AM_MAKEFLAGS) check-coverage-report + +clean-local: clean-coverage +clean-coverage: + rm -rf $(PERL_COVERAGE_DB) + +.PHONY: check-coverage check-coverage-run check-coverage-report clean-coverage |