Integrate mainline
[p5sagit/p5-mst-13.2.git] / t / TEST
diff --git a/t/TEST b/t/TEST
index 481cc79..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');
@@ -166,8 +174,8 @@ EOT
        open(SCRIPT,"<$test") or die "Can't run $test.\n";
        $_ = <SCRIPT>;
        close(SCRIPT) unless ($type eq 'deparse');
-       if (/#!.*\bperl.*-\w*T/) {
-           $switch = '"-T"';
+       if (/#!.*\bperl.*-\w*([tT])/) {
+           $switch = qq{"-$1"};
        }
        else {
            $switch = '';
@@ -201,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)