-----BEGIN PGP SIGNED MESSAGE-----
Moin,
On 28-Feb-02 Paul Johnson tried to scribble about:
> On Thu, Feb 28, 2002 at 07:23:43PM +0100, Tels wrote:
>
>> Anyway, it is not so easy to run your entire testsuite trough
>> Devel::Cover. Well, sort it is:
>>
>> PERL_DL_NONLAZY=1 /usr/local/bin/perl -Iblib/arch -Iblib/lib -e 'use
>> Test::Harness qw(&runtests $switches $verbose); $switches="-w
>> - -MDevel::Cover"; $verbose=0; runtests @ARGV;' t/*.t
>
> I normally go with:
>
> PERL5OPT='-MDevel::Cover' make test
>
> just don't try it on the Devel::Cover testsuite itself :-)
That doesn't work on most of my modules:
It usually covers the t/*.t files itself, not the lib. The files land in
t/cover_db, instead of ./cover_db, and ./cover can not use this directly
(due to various path problems).
te@null:~/perl/math/Math-String-1.19 > PERL5OPT='-MDevel::Cover' make test
PERL_DL_NONLAZY=1 /usr/local/bin/perl -Iblib/arch -Iblib/lib -e 'use
Test::Harness qw(&runtests $verbose); $verbose=0; runtests @ARGV;' t/*.t
t/sequence....ok
t/setgpm......ok
t/setnpm......ok
t/setspm......ok
t/stringpm....ok
t/study.......ok
All tests successful.
Files=6, Tests=569, 22 wallclock secs ( 9.44 cusr + 0.94 csys = 10.38 CPU)
- ---------------------------- ------ ------ ------ ------ ------ ------
- ------
File stmt branch path cond pod time
total
- ---------------------------- ------ ------ ------ ------ ------ ------
- ------
- -e 100.00 n/a n/a n/a n/a 100.00
100.00
Total 100.00 n/a n/a n/a n/a 100.00
100.00
- ---------------------------- ------ ------ ------ ------ ------ ------
- ------
(The summary is a bit useless)
te@null:~/perl/math/Math-String-1.19 > ./cover
Use of uninitialized value in concatenation (.) or string at ./cover line
72.
Use of uninitialized value in concatenation (.) or string at ./cover line
72.
Writing HTML to /.html
Use of uninitialized value in concatenation (.) or string at ./cover line
74.
Use of uninitialized value in concatenation (.) or string at ./cover line
74.
Use of uninitialized value in concatenation (.) or string at ./cover line
74.
Use of uninitialized value in concatenation (.) or string at ./cover line
74.
Cannot open /.html: Permission denied
te@null:~/perl/math/Math-String-1.19 >
Bug one: The default database is not "cover_db":
te@null:~/perl/math/Math-String-1.19 > diff -u cover cover2
- --- cover Thu Feb 28 19:04:38 2002
+++ cover2 Fri Mar 1 17:41:13 2002
@@ -262,7 +262,7 @@
{
get_options;
- - my $dbname = shift @ARGV;
+ my $dbname = shift @ARGV || 'cover_db';
my $db = Devel::Cover::DB->new(db => $dbname);
te@null:~/perl/math/Math-String-1.19 >
That fixes that.
Now:
te@null:~/perl/math/Math-String-1.19 > ./cover
Writing HTML to cover_db/cover_db.html
Unable to open -e: No such file or directory
- ---------------------------- ------ ------ ------ ------ ------ ------
- ------
File stmt branch path cond pod time
total
- ---------------------------- ------ ------ ------ ------ ------ ------
- ------
- -e 100.00 n/a n/a n/a n/a 100.00
100.00
Total 100.00 n/a n/a n/a n/a 100.00
100.00
- ---------------------------- ------ ------ ------ ------ ------ ------
- ------
te@null:~/perl/math/Math-String-1.19 >
Still not usefull.
te@null:~/perl/math/Math-String-1.19 > cd t
te@null:~/perl/math/Math-String-1.19/t > ../cover
Writing HTML to cover_db/cover_db.html
Unable to open t/sequence.t: No such file or directory
Unable to open t/setgpm.t: No such file or directory
Unable to open t/setnpm.t: No such file or directory
Unable to open t/setspm.t: No such file or directory
Unable to open t/stringpm.t: No such file or directory
Unable to open t/study.t: No such file or directory
- ---------------------------- ------ ------ ------ ------ ------ ------
- ------
File stmt branch path cond pod time
total
- ---------------------------- ------ ------ ------ ------ ------ ------
- ------
t/sequence.t 100.00 n/a n/a n/a n/a 9.88
100.00
t/setgpm.t 100.00 n/a n/a n/a n/a 12.36
100.00
t/setnpm.t 100.00 n/a n/a n/a n/a 10.77
100.00
t/setspm.t 99.47 n/a n/a n/a n/a 20.72
99.47
t/stringpm.t 100.00 n/a n/a n/a n/a 43.70
100.00
t/study.t 100.00 n/a n/a n/a n/a 2.56
100.00
Total 99.85 n/a n/a n/a n/a 100.00
99.85
- ---------------------------- ------ ------ ------ ------ ------ ------
- ------
te@null:~/perl/math/Math-String-1.19/t >
While it does something, I still don't get the libs covered. After that, I
got is somehow to cover the libs, but it was an ugly hour of hacking around
and I ended up with HTML file names starting with three dashes. Ugh ;)
So, my question: Would it be possible to make a make target, that automates
this process somehow and prints out the coverage summary? (Obviously I am
not able to do this, otherwise I would have done long ago ;)
It should, of course up to the author whether (s)he want's to use this, or
whether to release the module despite of poor coverage, but at least it
would allow a quick glance without fiddling around.
I shudder at the idea to re-hack this for each and every module I want to
cover, and for each version again and again. ;) And if it is so
complicated, not many people will use it, which is what we want to avoid.
It is a so usefull tool ;)
Best regards,
Tels
- --
perl -MDev::Bollocks -e'print Dev::Bollocks->rand(),"\n"'
proactively foster magnetic users
http://bloodgate.com/perl My current Perl projects
PGP key available on http://bloodgate.com/tels.asc or via email
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
iQEVAwUBPH+xkncLPEOTuEwVAQEU1gf8DUnEm0CSSlgKs7FTT2kPpWI2GEpd1Mw6
hgXsPXA63vIyJPAuz4SamoLibMqYAHqmpaV0hPe0hRQ3yNhbQ/AxxwGgqMinSxl8
Jzcvb/00yCOE5qfz46+oYDYJekrqtGiUM6VretMmwuRW85LDNvcKNmTgyxolImZr
P0n+SH56i7kMDp+eyHBNXooxMx4nkQNdLx1gXNmYXzlnFYeqTlmQXOHf0aWqtdFE
n0uCT0UYOV4fiSUDrhtitUXKh0CrBPM5vUPIT2B0LvcquOxJIZcMiBCPwkbrSFMr
DylHq8SOySRs5EYYVDTzwjxasN1zCjg2CGJ6eMnaEoTxmKH3j5gHBg==
=pfbV
-----END PGP SIGNATURE-----