BEGIN {
chdir 't' if -d 't';
- unshift @INC, '../lib';
+ @INC = '../lib';
$ENV{PERL5LIB} = '../lib';
require Config; import Config;
+ $ENV{PERL_DESTRUCT_LEVEL} = 0 unless $ENV{PERL_DESTRUCT_LEVEL} > 3;
}
$| = 1;
else
{ @w_files = sort glob("pragma/warn/*") }
-foreach (@w_files) {
+my $files = 0;
+foreach my $file (@w_files) {
- next if /\.orig$/ ;
+ next if /(~|\.orig|,v)$/;
- next if /(~|\.orig)$/;
-
- open F, "<$_" or die "Cannot open $_: $!\n" ;
+ open F, "<$file" or die "Cannot open $file: $!\n" ;
+ my $line = 0;
while (<F>) {
+ $line++;
last if /^__END__/ ;
}
{
local $/ = undef;
- @prgs = (@prgs, split "\n########\n", <F>) ;
+ $files++;
+ @prgs = (@prgs, $file, split "\n########\n", <F>) ;
}
close F ;
}
undef $/;
-print "1..", scalar @prgs, "\n";
+print "1..", scalar(@prgs)-$files, "\n";
for (@prgs){
+ unless (/\n/)
+ {
+ print "# From $_\n";
+ next;
+ }
my $switch = "";
my @temps = () ;
if (s/^\s*-\w+//){
print TEST $prog,"\n";
close TEST;
my $results = $Is_VMS ?
- `MCR $^X $switch $tmpfile` :
+ `./perl "-I../lib" $switch $tmpfile 2>&1` :
$Is_MSWin32 ?
`.\\perl -I../lib $switch $tmpfile 2>&1` :
`./perl -I../lib $switch $tmpfile 2>&1`;
# allow all tests to run when there are leaks
$results =~ s/Scalars leaked: \d+\n//g;
$expected =~ s/\n+$//;
- my $prefix = ($results =~ s/^PREFIX\n//) ;
+ my $prefix = ($results =~ s#^PREFIX(\n|$)##) ;
# any special options? (OPTIONS foo bar zap)
my $option_regex = 0;
if ($expected =~ s/^OPTIONS? (.+)\n//) {