From 1df3498620ecc1df99a2455e631a135f1710416f Mon Sep 17 00:00:00 2001 From: "Adrian M. Enache" Date: Sat, 19 Jul 2003 02:15:37 +0300 Subject: Re: [perl #22984] perl-5.8.1-RC2: TEST -bytecompile won't work at all Message-ID: <20030718201537.GA1574@ratsnest.hole> p4raw-id: //depot/perl@20220 --- t/TEST | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) (limited to 't/TEST') diff --git a/t/TEST b/t/TEST index 92a9d8fd0e..014fa124c3 100755 --- a/t/TEST +++ b/t/TEST @@ -21,7 +21,7 @@ if ($#ARGV >= 0) { $verbose = 1 if $1 eq 'v'; $torture = 1 if $1 eq 'torture'; $with_utf= 1 if $1 eq 'utf8'; - $byte_compile = 1 if $1 eq 'bytecompile'; + $bytecompile = 1 if $1 eq 'bytecompile'; $compile = 1 if $1 eq 'compile'; if ($1 =~ /^deparse(,.+)?$/) { $deparse = 1; @@ -125,9 +125,11 @@ unless (@ARGV) { if ($deparse) { _testprogs('deparse', '', @ARGV); } -elsif( $compile || $byte_compile ) { - _testprogs('compile', '', @ARGV) if $compile; - _testprogs('compile', '-B', @ARGV) if $byte_compile; +elsif( $compile ) { + _testprogs('compile', '', @ARGV); +} +elsif( $bytecompile ) { + _testprogs('bytecompile', '', @ARGV); } else { _testprogs('compile', '', @ARGV) if -e "../testcompile"; @@ -149,6 +151,12 @@ EOT ------------------------------------------------------------------------------ TESTING DEPARSER ------------------------------------------------------------------------------ +EOT + + print <<'EOT' if ($type eq 'bytecompile'); +------------------------------------------------------------------------------ +TESTING BYTECODE COMPILER +------------------------------------------------------------------------------ EOT $ENV{PERLCC_TIMEOUT} = 120 @@ -235,6 +243,25 @@ EOT open(RESULTS, $deparse) or print "can't deparse '$deparse': $!.\n"; } + elsif ($type eq 'bytecompile') { + my $perl = $ENV{PERL} || './perl'; + my $redir = ($^O eq 'VMS' ? '2>&1' : ''); + my $bswitch = "-MO=Bytecode,-H,-s,-TD`pwd`,"; + $bswitch .= "-TF," + if $test =~ m(chdir|pod/|CGI/t/carp|lib/DB); + $bswitch .= "-k," + if $test =~ m(deparse|terse|ext/Storable/t/code); + $bswitch .= "-k," + if $] < 5.009 && $test =~ m(avhv|hashwarn); + $bswitch .= "-b," + if $test =~ m(op/getpid); + my $bytecompile = + "$perl $testswitch $switch -I../lib $bswitch". + "-o$test.plc $test 2>/dev/null &&". + "$perl $testswitch $switch $utf $test.plc $redir|"; + open(RESULTS,$bytecompile) + or print "can't byte-compile '$bytecompile': $!.\n"; + } elsif ($type eq 'perl') { my $perl = $ENV{PERL} || './perl'; my $redir = ($^O eq 'VMS' ? '2>&1' : ''); -- cgit v1.2.1