unpack("C", ...) was left slightly unfinished by #8865.
[p5sagit/p5-mst-13.2.git] / t / TEST
diff --git a/t/TEST b/t/TEST
index 6237f9e..98d5fe3 100755 (executable)
--- a/t/TEST
+++ b/t/TEST
@@ -1,15 +1,18 @@
 #!./perl
 
-# Last change: Fri May 28 03:16:57 BST 1999
-
 # This is written in a peculiar style, since we're trying to avoid
 # most of the constructs we'll be testing for.
 
 $| = 1;
 
-if ($#ARGV >= 0 && $ARGV[0] eq '-v') {
-    $verbose = 1;
-    shift;
+# Cheesy version of Getopt::Std.  Maybe we should replace it with that.
+if ($#ARGV >= 0) {
+    foreach my $idx (0..$#ARGV) {
+       next unless $ARGV[$idx] =~ /^-(\w+)$/;
+       $verbose = 1 if $1 eq 'v';
+       $with_utf= 1 if $1 eq 'utf8';
+       splice(@ARGV, $idx, 1);
+    }
 }
 
 chdir 't' if -f 't/TEST';
@@ -24,7 +27,7 @@ $ENV{EMXSHELL} = 'sh';        # For OS/2
 
 if ($#ARGV == -1) {
     @ARGV = split(/[ \n]/,
-      `echo base/*.t comp/*.t cmd/*.t io/*.t; echo op/*.t pragma/*.t lib/*.t`);
+      `echo base/*.t comp/*.t cmd/*.t run/*.t io/*.t; echo op/*.t pragma/*.t lib/*.t`);
 }
 
 %infinite = ( 'comp/require.t', 1, 'op/bop.t', 1, 'lib/hostname.t', 1 ); 
@@ -86,14 +89,18 @@ EOT
            $switch = '';
        }
 
+       my $utf = $with_utf ? '-I../lib -Mutf8'
+                           : '';
+       my $testswitch = '-I. -MTestInit'; # -T will strict . from @INC
        if ($type eq 'perl') {
-           my $run = "./perl$switch $test |"; 
+           my $run = "./perl $testswitch $switch $utf $test |"; 
            open(RESULTS,$run) or print "can't run '$run': $!.\n";
        }
        else {
            my $compile =
-               "./perl -I../lib ../utils/perlcc -o ./$test.plc ./$test "
-               ." && ./$test.plc |";
+               "./perl $testswitch -I../lib ../utils/perlcc -o ".
+                "./$test.plc $utf ./$test ".
+               " && ./$test.plc |";
            open(RESULTS, $compile)
                or print "can't compile '$compile': $!.\n";
            unlink "./$test.plc";
@@ -114,9 +121,20 @@ EOT
                    $ok = 1;
                }
                else {
-                   $next = $1, $ok = 0, last if /^not ok ([0-9]*)/;
-                   if (/^ok (\d+)(\s*#.*)?/ && $1 == $next) {
-                       $next = $next + 1;
+                   if (/^(not )?ok (\d+)(\s*#.*)?/ &&
+                       $2 == $next) 
+                   {
+                       my($not, $num, $extra) = ($1, $2, $3);
+                       my($istodo) = $extra =~ /^\s*#\s*TODO/ if $extra;
+
+                       if( $not && !$istodo ) {
+                           $ok = 0;
+                           $next = $num;
+                           last;
+                       }
+                       else {
+                           $next = $next + 1;
+                       }
                     }
                     elsif (/^Bail out!\s*(.*)/i) { # magic words
                         die "FAILED--Further testing stopped" . ($1 ? ": $1\n" : ".\n");