develooper Front page | perl.perl5.porters | Postings from November 2003

make test and warnings

Thread Next
From:
Fergal Daly
Date:
November 16, 2003 14:36
Subject:
make test and warnings
Message ID:
200311162236.10845.fergal@esatclear.ie
on 5.8.2 and others, tests don't seem to be running with -w so this piece from 
Exporter.t

my $warnings;
BEGIN {
    $SIG{__WARN__} = sub { $warnings = join '', @_ };
    package Testing::Unused::Vars;
    @ISA = qw(Exporter);
    @EXPORT = qw(this $TODO that);

    package Foo;
    Testing::Unused::Vars->import;
}

::ok( !$warnings, 'Unused variables can be exported without warning' ) ||
  print "# $warnings\n";

passes when it should fail.

Turning on -w for all tests makes a lot of noise but it also causes 8 failures 
on 5.8.2, at least one of which is real. It may not be a good idea to have 
them on for the core tests as they're testing lots of stuff that should cause 
warnings but it might be a good idea to turn them on for all the modules and 
let the module tests turn it off if it's not appropriate,

F



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