Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Perl: porters

Tesing Pod::Coverage and bleadperl

 

 

Perl porters RSS feed   Index | Next | Previous | View Threaded


steve at fisharerojo

Nov 13, 2006, 7:31 PM

Post #1 of 2 (223 views)
Permalink
Tesing Pod::Coverage and bleadperl

One thing I noticed with testing modules with bleadperl was that some modules
were failing Pod coverage tests (File::Slurp for example). The problem
seems to be caused by the changes to constant subroutines in bleadperl.

For example, a simple module like...

package Failing::Pod::Coverage;

use warnings;
use strict;

use POSIX qw( :fcntl_h ) ;
use Fcntl qw( :DEFAULT ) ;
use Symbol;

1;

__END__

=head1 NAME

Failing::Pod::Coverage - test failing Pod coverage

fails like...

t/pod-coverage....
# Failed test 'Pod coverage on Failing::Pod::Coverage'
# at /tmp/bleadperl/lib/site_perl/5.9.5/Test/Pod/Coverage.pm line 126.
# Coverage for Failing::Pod::Coverage is 0.0%, with 22 naked subroutines:
# FD_CLOEXEC
# F_DUPFD
# F_GETFD
# F_GETFL
# F_GETLK
# F_RDLCK
# F_SETFD
# F_SETFL
# F_SETLK
# F_SETLKW
# F_UNLCK
# F_WRLCK
# O_ACCMODE
# O_APPEND
# O_CREAT
# O_EXCL
# O_NOCTTY
# O_NONBLOCK
# O_RDONLY
# O_RDWR
# O_TRUNC
# O_WRONLY
# Looks like you failed 1 test of 1.
t/pod-coverage....dubious
Test returned status 1 (wstat 256, 0x100)
DIED. FAILED test 1
Failed 1/1 tests, 0.00% okay


So what I'm wondering is whether there is a way to detect constant subs,
especially imported ones to prevent failing tests like what's above.

Steve Peters
steve[at]fisharerojo.org


nick at ccl4

Nov 14, 2006, 2:30 AM

Post #2 of 2 (207 views)
Permalink
Re: Tesing Pod::Coverage and bleadperl [In reply to]

On Mon, Nov 13, 2006 at 09:31:19PM -0600, Steve Peters wrote:

> So what I'm wondering is whether there is a way to detect constant subs,
> especially imported ones to prevent failing tests like what's above.

It's not possible to detect if they've been imported, simply because they
are so memory frugal that they don't store that information anywhere:

$ ./perl -Ilib -MPOSIX -MDevel::Peek -e 'Dump $POSIX::{EOF}'
SV = RV(0x183b76c) at 0x183b760
REFCNT = 1
FLAGS = (ROK)
RV = 0x183b750
SV = IV(0x183b74c) at 0x183b750
REFCNT = 2
FLAGS = (IOK,READONLY,pIOK)
IV = -1

$ ./perl -Ilib -MPOSIX -MDevel::Peek -e 'Dump $::{EOF}'
SV = RV(0x18640ec) at 0x18640e0
REFCNT = 1
FLAGS = (ROK)
RV = 0x183b750
SV = IV(0x183b74c) at 0x183b750
REFCNT = 2
FLAGS = (IOK,READONLY,pIOK)
IV = -1

It might be possible to add something to the flags on the RV stored in
the symbol table of the imported package, so that if it's turned into
a more regular PVCV by taking a reference:

$ ./perl -Ilib -MPOSIX -MDevel::Peek -e 'Dump $::{EOF}; eval "\&EOF"; Dump $::{EOF}'
SV = RV(0x18640ec) at 0x18640e0
REFCNT = 1
FLAGS = (ROK)
RV = 0x183b750
SV = IV(0x183b74c) at 0x183b750
REFCNT = 2
FLAGS = (IOK,READONLY,pIOK)
IV = -1
SV = PVGV(0x186a7e8) at 0x18640e0
REFCNT = 1
FLAGS = (SCREAM,MULTI,IN_PAD)
NAME = "EOF"
NAMELEN = 3
GvSTASH = 0x1800ee0 "main"
GP = 0x1105e30
SV = 0x0
REFCNT = 1
IO = 0x0
FORM = 0x0
AV = 0x0
HV = 0x0
CV = 0x18010c0
CVGEN = 0x0
LINE = 1
FILE = "(eval 3)"
FLAGS = 0xa
EGV = 0x18640e0 "EOF"

then the exported-ness is added in.

Nicholas Clark

Perl porters RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.