Paul Johnson wrote: [...]
And here is another view on the data, this time with the Perl code included.
http://pjcj.sytes.net/cover/mod_perl-1.99_13/cover_db-5.9.2/coverage.html
(That's on my local machine, so it may be a little unreliable.)
This was using apache-2.0.49, mod_perl-1.99_13, and bleadperl from a couple of days ago. Oh, and gcc 3.3.3 and Devel::Cover 0.43 plus a couple of patches to get gcov2perl working again.
I have included all the perl code in the report (normally the code under t/ would not be reported on) because what strikes me most is the low coverage of the perl code, and the number of perl modules which don't ever appear to be use'd and hence don't even appear on the report.
Now it's quite possible that I have not run the tests correctly, but inserting "die" near the top of a couple of random (apparently untested) modules didn't appear to cause any test failures. I count 388 .pm files in the mod_perl tree, and only 25 of the have any coverage at all.
The commands I used were:
$ perl5.9.2 Makefile.PL MP_APXS=/usr/local/pkg/apache-2.0.49/bin/apxs MODPERL_CC='gcc -fprofile-arcs -ftest-coverage' $ HARNESS_PERL_SWITCHES=-I/home/pjcj/g/perl/dev/Devel-Cover/blib/lib\ -I/home/pjcj/g/perl/dev/Devel-Cover/blib/arch\ -MDevel::Cover=-ignore,Cover,-select,^t/ make test $ for f (**/*.c) for> (chdir `dirname $f`; gcov `basename $f`) $ perl5.9.2 -I/home/pjcj/g/perl/dev/Devel-Cover/blib/lib -I/home/pjcj/g/perl/dev/Devel-Cover/blib/arch /home/pjcj/g/perl/dev/Devel-Cover/cover
(The -I's there are just to pick up my development copy of Devel::Cover.)
Nice!
Have I made some mistake here, is Devel::Cover wrong, or is the coverage really that bad?
Most module under modperl-2.0/lib and modperl-2.0/Apache-Test/lib (though in your report moved to blib) aren't used by mod_perl runtime. They are used during mod_perl build and test setup build. I'm sure if you exclude those the coverage will be more than 80%. That's why gozer's report's is much closer to reality (even though it has no Total numbers, it's easy to see that most of the API is well covered.
Overall the coverage looks great to me and it'll be even better once we finish polishing the API, which will require having all of them tested. Of course new tests for those uncovered areas are more than welcome. That's one of the main reasons 2.0 is not released yet - some APIs aren't tested/polished yet.
For those entries which are reported to be not very well covered, it's not necessarily true, since 'make test' will exercise different parts of the code depending on the used Perl. I wonder if it's possible to run the test suite under several builds (5.6.1, 5.6.1-ithread, 5.8.3, 5.8.3-ithread) and then merge the results.
This is certainly possible using the Devel::Cover framework, but if I understand correctly, a lot of the files are generated and will be slightly different for each perl version. In this case current Devel::Cover behaviour is to drop the results for the old version of the file.
Well, I supposed what it was suggesting is that you will get raw input data across several builds and then average them or similar. The main point is that the report is never correct, since some parts of the API are not run under certains perls and they are covered by the test suite.
-- __________________________________________________________________ Stas Bekman JAm_pH ------> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
