The warning no more comes from util.c, it comes from numeric.c.
[p5sagit/p5-mst-13.2.git] / t / pragma / warnings.t
index 71fb0df..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+//){
@@ -79,6 +87,8 @@ for (@prgs){
                   `./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+$//;