Click here to get back home

Understanding the Devel::Cover module generated reports

 HomeNewsGroups | Search | About
 comp.lang.perl.modules    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Understanding the Devel::Cover module generated reports Siva 08-17-2004
Posted by Siva on August 17, 2004, 12:10 pm
Please log in for more thread options
Can anybody please help me in understanding Devel::Cover module in
Perl? Your help is greatly appreciated. I am trying to use the module
Devel::Cover and I can't understand the coverage report.

This is my environment

Solaris 2.8, Perl 5.8.5 and Devel::Cover v0.47

I am executing a test program which tests the following modules
AAAAA.pm
BBBBB.pm
CCCCC.pm
DDDDD.pm
EEEEE.pm
FFFFFF.pm

I am having a test program called validate which executes the test
programs v_code_AAAAA.t, v_code_BBBBB.t, v_code_CCCCC.t,
v_code_DDDDD.t and v_code_EEEEE.t and v_code_FFFFF.t. Each of these
programs includes the required, respective modules.

In the validate program I have a similar code

*****************************************
#! /opt/ABCDEF/perl/bin/perl -w -I/opt/ABCDEF/bin/lib

use strict;
use Test::Harness qw(&runtests $verbose);

my @tests;
@tests = sort glob "v_code_*.t";

$Test::Harness::verbose = 1;
Test::Harness::runtests (@tests);
exit 0;
***************************************
But when I run the coverage report this code using the following
commands
Perl -Mdevel::Cover validate
Cover -report html

1. I don't see the CCCCC module and the FFFFF module in the coverage
report.
2. Also for the module that shows up (AAAAA, BBBBB, DDDDD and EEEEE)
in the coverage report when I look into the subroutine coverage I
don't see all the subroutine that are being tested show up in the
coverage report.

But when I run the individual test programs separately I am able to
see that the subroutine where covered as covered in the test program.


Thanks
-Siva


Posted by Jim Keenan on August 17, 2004, 4:30 pm
Please log in for more thread options
csivak24@yahoo.co.uk (Siva) wrote in message
> Can anybody please help me in understanding Devel::Cover module in
> Perl? Your help is greatly appreciated. I am trying to use the module
> Devel::Cover and I can't understand the coverage report.
>

Easy on that "Post message" button, Siva. You posted the same message
4 times.

I'm not going to answer your question directly, but, as a fellow new
user of Devel::Cover, I will share my own experience. I've been using
it to improve the test coverage of my CPAN module List::Compare. This
distribution is set up in a very CPAN-standard format, i.e., all the
tests are named *.t, are held in the /t subdirectory and are listed in
the MANIFEST. Once I've saved my edits, I change to the directory
where Makefile.PL is located and proceed as follows (as per
Devel::Cover documentation):

perl Makefile.PL
make
cover - delete # this deletes any previous Devel::Cover
# database in the same directory tree
HARNESS_PERL_SWITCHES=-MDevel::Cover make test
cover

The last command generates the HTML version of the coverage reports.
I also like to get this in a plain-text file, for which I call

cover cover_db -report=text > [arbitrarily_named_file.txt]

If you've got your module and tests set up in the standard format,
then this should work for you. HTH.

jimk


Similar ThreadsPosted
Devel::Cover failing with 'bizarre copy of hash in leave' error October 21, 2004, 2:09 pm
Adding XSLT information to XML generated by DBIx::XML_RDB July 20, 2008, 10:00 am
[RFC] Devel::Dependencies January 4, 2006, 7:47 am
Devel::StackTrace November 16, 2006, 9:06 am
WARNING do not install Devel::Fail::MakeTest February 11, 2005, 7:53 am
"Devel::DProf" on a PERL script uses "Test::More" December 5, 2005, 5:36 pm
Lower case module name for non-pragma module January 4, 2005, 10:19 am
RFC: New module 'Module::Bundled::Files' August 26, 2005, 3:49 pm
help with an MD5.pm module!! September 3, 2005, 11:39 pm
Looking for RTP module December 9, 2004, 9:17 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap