Skip to content

Commit

Permalink
Perl coverage convenience targets.
Browse files Browse the repository at this point in the history
* Makefile.am (PERL_COVERAGE_DB, PERL_COVERAGE_FLAGS)
(PERL_COVER): New variables.
(check-coverage, check-coverage-run, check-coverage-report)
(clean-coverage): New phony targets.
(clean-local): Depend on clean-coverage.

Signed-off-by: Ralf Wildenhues <[email protected]>
  • Loading branch information
Ralf Wildenhues authored and Ralf Wildenhues committed Oct 31, 2009
1 parent 81c80d1 commit 931ae9f
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
2009-10-31 Ralf Wildenhues <[email protected]>

Perl coverage convenience targets.
* Makefile.am (PERL_COVERAGE_DB, PERL_COVERAGE_FLAGS)
(PERL_COVER): New variables.
(check-coverage, check-coverage-run, check-coverage-report)
(clean-coverage): New phony targets.
(clean-local): Depend on clean-coverage.

2009-10-28 Eric Blake <[email protected]>

Fix corner cases in AS_LITERAL_IF and AS_TR_SH.
Expand Down
29 changes: 29 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 931ae9f

Please sign in to comment.