The warning no more comes from util.c, it comes from numeric.c.
[p5sagit/p5-mst-13.2.git] / t / pragma / warnings.t
index 41324e6..09b41fb 100644 (file)
@@ -2,7 +2,7 @@
 
 BEGIN {
     chdir 't' if -d 't';
-    unshift @INC, '../lib';
+    @INC = '../lib';
     $ENV{PERL5LIB} = '../lib';
     require Config; import Config;
 }
@@ -11,6 +11,7 @@ $| = 1;
 
 my $Is_VMS     = $^O eq 'VMS';
 my $Is_MSWin32 = $^O eq 'MSWin32';
+my $Is_NetWare = $^O eq 'NetWare';
 my $tmpfile = "tmp0000";
 my $i = 0 ;
 1 while -f ++$tmpfile;
@@ -24,30 +25,37 @@ if (@ARGV)
 else
   { @w_files = sort glob("pragma/warn/*") }
 
-foreach (@w_files) {
+my $files = 0;
+foreach my $file (@w_files) {
 
-    next if /\.orig$/ ;
+    next if $file =~ /(~|\.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+//){
@@ -76,9 +84,11 @@ for (@prgs){
     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` :
+                 $Is_NetWare ?
+                  `perl -I../lib $switch $tmpfile 2>&1` :
                   `./perl -I../lib $switch $tmpfile 2>&1`;
     my $status = $?;
     $results =~ s/\n+$//;
@@ -91,7 +101,7 @@ for (@prgs){
     # 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//) {