Discussion:
Devel::Cover: uninitialized value warning in 'cover'
James E Keenan
2012-06-02 15:49:09 UTC
Permalink
As I have described previously, I use Devel::Cover to measure the extent
to which parts of the Parrot virtual machine's test suite exercises
certain Perl 5 programs and modules in Parrot's configuration and build
systems. Today for the first time I noticed this uninitialized value
warning, which occurs after the test harness has completed and the
cover_db has been built, but just before I call 'cover' to generate a
report or summary:

#####
Reading database from /home/jimk/parrot/coverage/configure-build
Use of uninitialized value $Devel::Cover::Ignore_filenames in regexp
compilation at
/usr/local/lib/perl5/site_perl/5.16.0/i686-linux/Devel/Cover/DB.pm line 882.


------------------------------------------ ------ ------ ------ ------
------
File stmt bran cond sub
total
------------------------------------------ ------ ------ ------ ------
------
/usr/local/bin/perldoc 100.0 50.0 n/a 100.0
90.9
/usr/local/bin/pod2man 97.1 50.0 33.3 100.0
80.4
...
#####

Here are the relevant sections of Devel::Cover::DB:

#####
852 sub cover
853 {
854 my $self = shift;
...
880 unless ($digest)
881 {
882 print STDERR "Devel::Cover: Can't find digest for
$file\n"
883 unless $Devel::Cover::Silent ||
884 $file =~ $Devel::Cover::Ignore_filenames ||
885 ($Devel::Cover::Self_cover &&
886 $file =~ q|/Devel/Cover[./]|);
887 next;
888 }
#####

I cannot locate any other reference to $Devel::Cover::Ignore_filenames
in Devel::Cover::DB. That variable is listed in 'use vars' in
Devel::Cover, but Devel::Cover::DB doesn't (directly, at least) import
Devel::Cover.

Here is the point in the 'cover' executable where it appears
Devel::Cover::DB::cover() is called:

#####
334 my %f = map { $_ => 1 } (@{$Options->{select}}
335 ? map glob, @{$Options->{select}}
336 : $db->cover->items);
#####

I can't find any location within 'cover' where
$Devel::Cover::Ignore_filenames is set to a defined value. However,
when I used a hacked-up version of 'cover' with this:

#####
20 $Devel::Cover::Ignore_filenames = '';
21 use Devel::Cover::DB;
#####

... the uninitialized value warning went away.

Can we get a less hackish way of preventing this uninitialized value
warning?

Thank you very much.
Jim Keenan
Matthew Horsfall (alh)
2012-06-04 18:46:08 UTC
Permalink
Post by James E Keenan
Use of uninitialized value $Devel::Cover::Ignore_filenames in regexp
compilation at
/usr/local/lib/perl5/site_perl/5.16.0/i686-linux/Devel/Cover/DB.pm line 882.
James,

This was reported and I believe solved as part of another bug just a
little bit ago, looking at github it's slated for release "soon", but
hasn't been yet.

Here's the relevant commit:

https://github.com/pjcj/Devel--Cover/commit/dd89615c50127bb3900c5653d631c2cee22f10cb

And the original bug:

https://github.com/pjcj/Devel--Cover/issues/12

On a side note, I'm not sure if the perl-qa list is the place to
report Devel::Cover issues or not, but I know if you have a github
account you can report them directly on the project's page, or throw
them up on RT.

Cheers,

-- Matthew Horsfall (alh)
James E Keenan
2012-06-04 22:56:01 UTC
Permalink
Post by Matthew Horsfall (alh)
Post by James E Keenan
Use of uninitialized value $Devel::Cover::Ignore_filenames in regexp
compilation at
/usr/local/lib/perl5/site_perl/5.16.0/i686-linux/Devel/Cover/DB.pm line 882.
On a side note, I'm not sure if the perl-qa list is the place to
report Devel::Cover issues or not, but I know if you have a github
account you can report them directly on the project's page, or throw
them up on RT.
For many years -- long before the invention of github -- I've followed
this instruction in the documentation for Devel/Cover.pm:

"The most appropriate mailing list on which to discuss this module would
be perl-qa."

And pjcj has always responded.

If that's no longer an appropriate location to report problems with
Devel::Cover, then the docs need updating. I'll do whatever Paul advises.

Thank you very much.
Jim Keenan
Matthew Horsfall (alh)
2012-06-04 23:11:06 UTC
Permalink
Post by Matthew Horsfall (alh)
On a side note, I'm not sure if the perl-qa list is the place to
report Devel::Cover issues or not, but I know if you have a github
account you can report them directly on the project's page, or throw
them up on RT.
For many years -- long before the invention of github -- I've followed this
"The most appropriate mailing list on which to discuss this module would be
perl-qa."
And pjcj has always responded.
If that's no longer an appropriate location to report problems with
Devel::Cover, then the docs need updating.  I'll do whatever Paul advises.
I admit I haven't looked at the docs in a little while myself.

I hope my tone didn't come off as instructive or rude, it was more
curious than anything because I myself wasn't sure.

Apologies :)

-- Matthew Horsfall (alh)
Paul Johnson
2012-06-04 23:55:40 UTC
Permalink
Post by Matthew Horsfall (alh)
Post by James E Keenan
Use of uninitialized value $Devel::Cover::Ignore_filenames in regexp
compilation at
/usr/local/lib/perl5/site_perl/5.16.0/i686-linux/Devel/Cover/DB.pm line 882.
James,
This was reported and I believe solved as part of another bug just a
little bit ago, looking at github it's slated for release "soon", but
hasn't been yet.
https://github.com/pjcj/Devel--Cover/commit/dd89615c50127bb3900c5653d631c2cee22f10cb
https://github.com/pjcj/Devel--Cover/issues/12
This is correct. Thanks for mentioning it.
Post by Matthew Horsfall (alh)
On a side note, I'm not sure if the perl-qa list is the place to
report Devel::Cover issues or not, but I know if you have a github
account you can report them directly on the project's page, or throw
them up on RT.
If others don't mind, I'm happy for people to discuss Devel::Cover here.
Obviously it's good to get bug reports into github or RT, but often I
get mail or I'm contacted in other ways, and often I don't get around to
replying in a timely fashion. I'm hoping to improve on that at least
while the grant is ongoing (I'm going though my mail backlog), but I'm
always grateful when people ask things in public and other people give
answers, as in this case.

Oh, and if there is anything that anyone has contacted me about and
hasn't got a reply, if it's not in github or RT, please feel free to
contact me again now that I should be in a better position to reply.
--
Paul Johnson - ***@pjcj.net
http://www.pjcj.net
Loading...