Skip Menu |

This queue is for tickets about the Pod-Coverage CPAN distribution.

Report information
The Basics
Id: 119215
Status: new
Priority: 0/
Queue: Pod-Coverage

People
Owner: Nobody in particular
Requestors: felix [...] bioinf.uni-leipzig.de
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Pod::Coverage::ExportOnly does not find exported subs
Date: Mon, 12 Dec 2016 16:42:14 +0100
To: bug-Pod-Coverage [...] rt.cpan.org
From: Felix Kuehnl <felix [...] bioinf.uni-leipzig.de>
Hi, I just tried out Pod::Coverage::ExportOnly and it seems to me that it is not checking the coverage of any subs of my module at all. When I run perl -wle 'use v5.12; use Pod::Coverage::ExportOnly package => "My::Module"'; I get My::Module has a Pod::Coverage::ExportOnly rating of unrated (no public symbols defined) even though I export undocumented symbols in My::Module. I suspect the problem lies in the fact that in the code of Pod::Coverage::ExportOnly: sub _get_syms { my $self = shift; my $package = shift; # lifted from UNIVERSAL::exports no strict 'refs'; my %exports = map { $_ => 1 } @{$package.'::EXPORT'}, @{$package.'::EXPORT_OK'}; return keys %exports; } the module to be checked (here: My::Module) is not require'd first, and so @{$package.'::EXPORT'}always evaluates to an empty list. I modified the code by inserting the following lines, taken from the _get_syms sub of Pod::Coverage, after the line 'my $package = shift;': print "requiring '$package'\n" if TRACE_ALL; eval qq{ require $package }; if ($@) { print "require failed with $@\n" if TRACE_ALL; $self->{why_unrated} = "requiring '$package' failed"; return; } Additionally, I inserted the line BEGIN { defined &TRACE_ALL or eval 'sub TRACE_ALL () { 0 }' } in front of the sub definition to define TRACE_ALL (it is taken from Pod::Coverage, too). Now I am getting the expected result: My::Module has a Pod::Coverage::ExportOnly rating of 0 The following are uncovered: sub1, sub2 ... I am running Perl 5.22.2 on a Fedora 22 Linux (Kernel 4.6.7-200). Am I using the module in a wrong way or is this a bug? Thanks for your help! Regards, FelixKuehnl