Skip to content

Commit adb39cc

Browse files
committed
Add support for generating test coverage stats
Via Devel::Cover. Signed-off-by: Frank Terbeck <[email protected]>
1 parent 41aa025 commit adb39cc

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ optest.pl
1616
tests/data/*
1717
tags
1818
TAGS
19+
cover_db/

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,11 @@ test-output: genperlscripts
135135
test-suite: test-check
136136
prove -Imodules -v tests/*.t
137137

138+
coverage:
139+
cover -delete
140+
PERL5OPT='-MDevel::Cover=-ignore,.,-select,ARename.pm,+select,ARename/.+\.pm' $(MAKE) test-all
141+
cover
142+
138143
prepare-test-data:
139144
./bin/gentestsdata.sh
140145

@@ -151,4 +156,4 @@ tags:
151156
ctags --language-force=perl arename.in ARename.pm.in ataglist.in
152157
ctags -e --language-force=perl arename.in ARename.pm.in ataglist.in
153158

154-
.PHONY: install install-doc distclean clean all doc test-check tags
159+
.PHONY: coverage install install-doc distclean clean all doc test-check tags

TESTING

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ arename's test suite
2222

2323
+ fakeroot (opt) - fake root previleges
2424
+ perlcritic (opt) - check code style using ./perlcriticrc.
25+
+ Devel::Cover - for generating test coverage statistics
26+
(optional)
2527

2628

2729
This test suite should run without failing tests on all systems. If
@@ -85,3 +87,15 @@ arename's test suite
8587
To run the installation tests by hand, do (from the source's root):
8688

8789
% fakeroot /bin/sh ./tests/inst_t.sh
90+
91+
92+
TEST COVERAGE
93+
94+
In order to have some sort of measurement about which parts of the code
95+
is currently covered by the test-suite, you may call the following:
96+
97+
% make coverage
98+
% $BROWSER cover_db/coverage.html
99+
100+
This function depends on the availability of the Devel::Cover module,
101+
available from CPAN.

0 commit comments

Comments
 (0)