Subject: | Pod::Coverage 0.19 no longer sees Moose generated methods. |
Date: | Sat, 08 Nov 2008 19:02:13 +1100 |
To: | bug-Pod-Coverage [...] rt.cpan.org |
From: | Daniel Pittman <daniel [...] rimspace.net> |
G'day.
Between Pod::Coverage 0.18 and 0.19 the module changed to include this
test in 'sub _get_syms':
# in 5.005 this flag is not exposed via B, though it exists
my $imported_cv = eval { B::GVf_IMPORTED_CV() } || 0x80;
next if $o->GvFLAGS & $imported_cv;
This test is used, as far as I can tell, to exclude imported code from
the module but, unfortunately, trips for code generated with Moose.
This is also the cause of the bug in ticket #33747:
http://rt.cpan.org/Ticket/Display.html?id=33747
In that case Class::Data::Accessor is the generating module, but the
symptoms are identical; I instrumented the code and the GvFLAGS do
contain the appropriate GVf_IMPORTED_CV value:
] perl -Ilib -MPod::Coverage=Finance::Vanguard -e666
getting pod location for 'Finance::Vanguard'
parsing 'lib/Finance/Vanguard.pm'
requiring 'Finance::Vanguard'
walking symbols
# warn $syms->as_string;
arrays
Finance::Vanguard::ISA
functions
Finance::Vanguard::DESTROY
Finance::Vanguard::blessed
Finance::Vanguard::confess
Finance::Vanguard::get
Finance::Vanguard::meta
Finance::Vanguard::new
Finance::Vanguard::ua
hashes
ios
packages
Finance::Vanguard::::ISA::CACHE
scalars
Finance::Vanguard::::ISA::CACHE::
Finance::Vanguard::BEGIN
Finance::Vanguard::DESTROY
Finance::Vanguard::ISA
Finance::Vanguard::VERSION
Finance::Vanguard::__ANON__
Finance::Vanguard::blessed
Finance::Vanguard::can
Finance::Vanguard::confess
Finance::Vanguard::get
Finance::Vanguard::isa
Finance::Vanguard::meta
Finance::Vanguard::new
Finance::Vanguard::ua
unknowns
at lib/Pod/Coverage.pm line 311.
# warn $sym, " => ", sprintf('%08x', $o->GvFLAGS);
Finance::Vanguard::ua => 00000086 at lib/Pod/Coverage.pm line 322.
Finance::Vanguard::get => 00000086 at lib/Pod/Coverage.pm line 322.
Finance::Vanguard::DESTROY => 00000086 at lib/Pod/Coverage.pm line 322.
Finance::Vanguard::new => 00000086 at lib/Pod/Coverage.pm line 322.
Finance::Vanguard::blessed => 00000086 at lib/Pod/Coverage.pm line 322.
Finance::Vanguard::confess => 00000086 at lib/Pod/Coverage.pm line 322.
Finance::Vanguard::meta => 00000086 at lib/Pod/Coverage.pm line 322.
tying shoelaces
$VAR1 = bless( {
'pod_from' => 'lib/Finance/Vanguard.pm',
'nonwhitespace' => undef,
'symbols' => {},
'private' => [
qr/(?-xism:^_)/,
qr/(?-xism:^import$)/,
qr/(?-xism:^DESTROY$)/,
qr/(?-xism:^AUTOLOAD$)/,
qr/(?-xism:^bootstrap$)/,
qr/(?-xism:^\()/,
qr/(?x-ism:^(TIE( SCALAR | ARRAY | HASH | HANDLE ) |
FETCH | STORE | UNTIE | FETCHSIZE | STORESIZE |
POP | PUSH | SHIFT | UNSHIFT | SPLICE | DELETE |
EXISTS | EXTEND | CLEAR | FIRSTKEY | NEXTKEY | PRINT | PRINTF |
WRITE | READLINE | GETC | READ | CLOSE | BINMODE | OPEN |
EOF | FILENO | SEEK | TELL)$)/,
qr/(?x-ism:^( MODIFY | FETCH )_( REF | SCALAR | ARRAY | HASH | CODE |
GLOB | FORMAT | IO)_ATTRIBUTES $)/,
qr/(?-xism:^CLONE(_SKIP)?$)/
],
'trustme' => [],
'package' => 'Finance::Vanguard'
}, 'Pod::Coverage' );
Finance::Vanguard has a Pod::Coverage rating of unrated (no public
symbols defined)
I suspect for now that this change should be reverted, and some other
mechanism to exclude imported symbols be used, since code generation
like this seems fairly reasonable to me...
Alternately, an option to include or exclude them would be good; missing
out on the useful Test::Pod::Coverage checks is saddening. :)
Regards,
Daniel
Details of my system:
Ubuntu package libpod-coverage-perl 0.19-1, which is Pod-Coverage-0.19
Perl version:
This is perl, v5.8.8 built for x86_64-linux-gnu-thread-multi
Copyright 1987-2006, Larry Wall
Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.
Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl". If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.
Operating System vendor and version:
Linux krosp 2.6.24-19-openvz #1 SMP Wed Aug 20 22:07:43 UTC 2008 x86_64 GNU/Linux