develooper Front page | perl.qa | Postings from December 2002

Re: Problem with coverage

Thread Next
From:
Paul Johnson
Date:
December 3, 2002 11:06
Subject:
Re: Problem with coverage
Message ID:
20021203190613.GA4571@pjcj.net
[ Please note followups set to perl-qa, perl-qa-metrics is pretty much dead ]

On Tue, Dec 03, 2002 at 07:45:04PM +0530, Rajanikanth Dandamudi wrote:

> Paul,
> 
> I had downloaded the Devel::Cover module form the URL
> http://search.cpan.org/author/PJCJ/Devel-Cover-0.20/ and trying to get
> the coverage for a program. I had installed the Devel::Cover module
> and here is what I had done:
> 
> * I am using the perl version 5.8.0 .
> 
> The command I had given is :
> 
> perl -MDevel::Cover=-db,program_1,-coverage,statement,time program_1.pl
> 
> The file program_1.pl contains:
> =================================
> #!/usr/local/bin/perl
> 
> print "Hello World\n";
> 
> =================================
> 
> The above command creates a directory and by name program_1 and
> creates a file by name cover.4 in it.
> 
> Now when I run the command :
> 
> cover program_1 -report text
> 
> I get the following output :
> 
> Reading database from program_1
> 
> 
> -------------------------------------------------------- ------ ------ ------
> File                                                       stmt   time  total
> -------------------------------------------------------- ------ ------ ------
> program_1.pl                                               0.00    n/a   0.00
> Total                                                      0.00    n/a   0.00
> -------------------------------------------------------- ------ ------ ------
> 
> 
> program_1.pl
> 
> line  err   stmt   time   code
> 1                         #!/usr/local/bin/perl
> 2
> 3     ***      0          print "Hello World\n";
> 4
> 
> Paul, I am not able to understand why is it showing the coverage as 0.

Neither am I.  I went through exactly the same procedure, except with
bleadperl, and everything worked as expected.  Did all of the tests
pass?  Is this a 64bit perl?  Has anyone ever run Devel::Cover with a 64
bit perl?  Maybe it's time for me to plug in my Tru64 box.

Could you send your perl -V and program_1/cover.4?

> Thanks and Regards,
> Rajanikanth
> 
> 
> Paul Johnson wrote:
> 
> > Rajanikanth Dandamudi said:
> > > Hai
> > >
> > > I am planning to get the coverage of a file by name program_1.pl . This
> > > program_1.pl dynamically loads a c module defined in program_1.so . This
> > > program_1.so is a 64 bit ELF shared library and the perl available in
> > > the standard location is a 32-bit perl.
> > >
> > > So I had downloaded the perl v5.8.0 from cpan and compiled to obtain
> > > 64-bit perl. The module Devel/Coverage.pm which I generally use for
> > > obtaining coverage is not part of the perl distribution. Hence I
> > > downloaded the package(Devel-Coverage-0.2.tar.gz) and installed the
> > > Devel/Coverage.pm module.
> > >
> > > Now when I run the following command to obtain the coverage :
> > >
> > > perl -d:Coverage program_1.pl
> > >
> > > I get the following error message:
> > >
> > > No DB::DB routine defined at
> > > /proj/dite/WorkArea/Raja/perl/install/lib/site_perl/5.8.0/Devel/Coverage.pm
> > > line 4.
> > > BEGIN failed--compilation aborted at
> > > /proj/dite/WorkArea/Raja/perl/install/lib/site_perl/5.8.0/Devel/Coverage.pm
> > > line 4.
> > > Compilation failed in require.
> > > BEGIN failed--compilation aborted.
> > >
> > >
> > > Can someone helpme in understanding what the above problem is and how to
> > > overcome this?
> >
> > This is a known problem.  Randy, the author, has said that he will provide
> > an updated version when he can.  I think the solution involves declaring
> > the DB::DB subroutine earlier, but I am not sure.  Your other options are
> > to go back to 5.6.1, or to try Devel::Cover.
> >
> > Devel::Cover should work on a 64 bit perl, but feel free to send me
> > feedback if you try it.

Randy, do you have any thoughts about this?

-- 
Paul Johnson - paul@pjcj.net
http://www.pjcj.net

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About