Re: [PATCH] ...while $var = glob(...)
[p5sagit/p5-mst-13.2.git] / t / TEST
diff --git a/t/TEST b/t/TEST
index d558749..278097a 100755 (executable)
--- a/t/TEST
+++ b/t/TEST
@@ -16,6 +16,8 @@ if ($#ARGV >= 0) {
        $core    = 1 if $1 eq 'core';
        $verbose = 1 if $1 eq 'v';
        $with_utf= 1 if $1 eq 'utf8';
+        $byte_compile = 1 if $1 eq 'bytecompile';
+        $compile = 1 if $1 eq 'compile';
        if ($1 =~ /^deparse(,.+)?$/) {
            $deparse = 1;
            $deparse_opts = $1;
@@ -97,14 +99,20 @@ unless (@ARGV) {
 %infinite = ();
 
 if ($deparse) {
-    _testprogs('deparse', @ARGV);
-} else {
-    _testprogs('perl', @ARGV);
-    _testprogs('compile', @ARGV) if (-e "../testcompile");
+    _testprogs('deparse', '',   @ARGV);
+}
+elsif( $compile || $byte_compile ) { 
+    _testprogs('compile', '',   @ARGV) if $compile;
+    _testprogs('compile', '-B', @ARGV) if $byte_compile;
+}
+else {
+    _testprogs('compile', '',   @ARGV) if -e "../testcompile";
+    _testprogs('perl',    '',   @ARGV);
 }
 
 sub _testprogs {
     $type = shift @_;
+    $args = shift;
     @tests = @_;
 
     print <<'EOT' if ($type eq 'compile');
@@ -163,19 +171,15 @@ EOT
 
        $test = $OVER{$test} if exists $OVER{$test};
 
-       open(SCRIPT,"<$test") or die "Can't run $test.\n";
-       $_ = <SCRIPT>;
-       close(SCRIPT) unless ($type eq 'deparse');
-       if (/#!.*perl(.*)$/) {
-           $switch = $1;
-           if ($^O eq 'VMS') {
-               # Must protect uppercase switches with "" on command line
-               $switch =~ s/-([A-Z]\S*)/"-$1"/g;
-           }
-       }
-       else {
-           $switch = '';
-       }
+       open(SCRIPT,"<$test") or die "Can't run $test.\n";
+       $_ = <SCRIPT>;
+       close(SCRIPT) unless ($type eq 'deparse');
+       if (/#!.*\bperl.*-\w*([tT])/) {
+           $switch = qq{"-$1"};
+       }
+       else {
+           $switch = '';
+       }
 
        my $file_opts = "";
        if ($type eq 'deparse') {
@@ -205,7 +209,7 @@ EOT
        }
        else {
            my $compile =
-               "./perl $testswitch -I../lib ../utils/perlcc -o ".
+               "./perl $testswitch -I../lib ../utils/perlcc -I .. $args -o ".
                 "$test.plc $utf $test ".
                " && $test.plc |";
            open(RESULTS, $compile)
@@ -316,7 +320,7 @@ SHRDLU_1
    ### in the 't' directory since most (>=80%) of the tests succeeded.
 SHRDLU_2
         if (eval {require Config; import Config; 1}) {
-           if (my $p = $Config{ldlibpthname}) {
+           if ($Config{usedl} && (my $p = $Config{ldlibpthname})) {
                warn <<SHRDLU_3;
    ### You may have to set your dynamic library search path,
    ### $p, to point to the build directory: