Integrate mainline
[p5sagit/p5-mst-13.2.git] / t / TEST
diff --git a/t/TEST b/t/TEST
index 0a63f0e..e455043 100755 (executable)
--- a/t/TEST
+++ b/t/TEST
@@ -9,6 +9,7 @@ $| = 1;
 if ($#ARGV >= 0) {
     foreach my $idx (0..$#ARGV) {
        next unless $ARGV[$idx] =~ /^-(\S+)$/;
+       $core    = 1 if $1 eq 'core';
        $verbose = 1 if $1 eq 'v';
        $with_utf= 1 if $1 eq 'utf8';
        if ($1 =~ /^deparse(,.+)?$/) {
@@ -64,15 +65,20 @@ sub _find_tests {
 }
 
 unless (@ARGV) {
-    foreach my $dir (qw(base comp cmd run io op lib)) {
+    foreach my $dir (qw(base comp cmd run io op)) {
         _find_tests($dir);
     }
+    _find_tests("lib") unless $core;
     my $mani = File::Spec->catdir($updir, "MANIFEST");
     if (open(MANI, $mani)) {
         while (<MANI>) { # similar code in t/harness
            if (m!^(ext/\S+/([^/]+\.t|test\.pl)|lib/\S+?(\.t|test\.pl))\s!) {
-               push @ARGV, $1;
-               $OVER{$1} = File::Spec->catdir($updir, $1);
+               $t = $1;
+               if (!$core || $t =~ m!^lib/[a-z]!)
+               {
+                   push @ARGV, $t;
+                   $OVER{$t} = File::Spec->catdir($updir, $t);
+               }
            }
        }
     } else {
@@ -176,8 +182,6 @@ EOT
            close(SCRIPT);
        }
 
-       $test = $OVER{$test} if exists $OVER{$test};
-
        my $utf = $with_utf ? '-I../lib -Mutf8' : '';
        my $testswitch = '-I. -MTestInit'; # -T will strict . from @INC
        if ($type eq 'deparse') {
@@ -220,7 +224,7 @@ EOT
                    $ok = 1;
                }
                else {
-                   if (/^(not )?ok (\d+)(\s*#.*)?/ &&
+                   if (/^(not )?ok (\d+)[^#]*(\s*#.*)?/ &&
                        $2 == $next)
                    {
                        my($not, $num, $extra) = ($1, $2, $3);