If you use Module::Build, there's already a ./Build target that does the coverage for you. This is an example of a brand new module bootstrapped using Module::Starter's module-starter utility:
$ module-starter --module Foo --mb --author "some 1" --email 'some1@ex
+ample.com'
Created starter directories and files
$ cd Foo
$ perl Build.PL
Checking whether your kit is complete...
Looks good
Checking prerequisites...
Looks good
Creating new 'Build' script for 'Foo' version '0.01'
$ ./Build help |grep cover
docs testcover
html testpodcoverage
$ ./Build testcover
t/00-load.........ok 1/1# Testing Foo 0.01, Perl 5.010000, /usr/bin/pe
+rl
t/00-load.........ok
+
t/boilerplate.....ok
+
t/pod-coverage....ok
+
t/pod.............ok
+
All tests successful.
Files=4, Tests=6, 8 wallclock secs ( 6.78 cusr + 0.45 csys = 7.23 C
+PU)
cover
Reading database from /home/hue/tmp/Foo/cover_db
---------------------------- ------ ------ ------ ------ ------ ------
+ ------
File stmt bran cond sub pod time
+ total
---------------------------- ------ ------ ------ ------ ------ ------
+ ------
blib/lib/Foo.pm 75.0 n/a n/a 50.0 100.0 100.0
+ 71.4
Total 75.0 n/a n/a 50.0 100.0 100.0
+ 71.4
---------------------------- ------ ------ ------ ------ ------ ------
+ ------
Writing HTML output to /home/hue/tmp/Foo/cover_db/coverage.html ...
done.
$ ./Build testpodcoverage
1..1
ok 1 - Pod coverage on Foo
--
David Serrano
(Please treat my english text just like Perl code, i.e. feel free to notify me of any syntax, grammar, style and/or spelling errors. Thank you!).
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|