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

make test and warnings

Thread Next
Fergal Daly
November 16, 2003 14:36
make test and warnings
Message ID:
on 5.8.2 and others, tests don't seem to be running with -w so this piece from 

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

    package Foo;

::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,


Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About