X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2FTEST;h=ef3d312a46f36f9fea263ee1148af815e7b63b9d;hb=579de012b31c51e885b06b54d62f0b1ebd2f0b18;hp=1bda4ef7930d12f413fa227077afbec5dc2f01b0;hpb=e77eedc24c0252a902559034f2aa207f216529cc;p=p5sagit%2Fp5-mst-13.2.git diff --git a/t/TEST b/t/TEST index 1bda4ef..ef3d312 100755 --- a/t/TEST +++ b/t/TEST @@ -1,149 +1,185 @@ #!./perl -# Last change: Fri Jan 10 09:57:03 WET 1997 +# 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] eq '-v') { +if ($#ARGV >= 0 && $ARGV[0] eq '-v') { $verbose = 1; shift; } chdir 't' if -f 't/TEST'; -die "You need to run \"make test\" first to set things up.\n" +die "You need to run \"make test\" first to set things up.\n" unless -e 'perl' or -e 'perl.exe'; +# check leakage for embedders +$ENV{PERL_DESTRUCT_LEVEL} = 2 unless exists $ENV{PERL_DESTRUCT_LEVEL}; + $ENV{EMXSHELL} = 'sh'; # For OS/2 -if ($ARGV[0] eq '') { - push( @ARGV, `dir/s/b base` ); - push( @ARGV, `dir/s/b comp` ); - push( @ARGV, `dir/s/b cmd` ); - push( @ARGV, `dir/s/b io` ); - push( @ARGV, `dir/s/b op` ); - push( @ARGV, `dir/s/b pragma` ); - push( @ARGV, `dir/s/b lib` ); +if ($#ARGV == -1) { + @ARGV = split(/[ \n]/, + `echo base/*.t comp/*.t cmd/*.t io/*.t; echo op/*.t pragma/*.t lib/*.t`); +} - grep( chomp, @ARGV ); - @ARGV = grep( /\.t$/, @ARGV ); - grep( s/.*t\\//, @ARGV ); -# @ARGV = split(/[ \n]/, -# `echo base/*.t comp/*.t cmd/*.t io/*.t; echo op/*.t pragma/*.t lib/*.t`); -} else { +%infinite = ( 'comp/require.t', 1, 'op/bop.t', 1, 'lib/hostname.t', 1 ); -@ARGV = map(glob($_),@ARGV); +_testprogs('perl', @ARGV); +_testprogs('compile', @ARGV) if (-e "../testcompile"); -} +sub _testprogs { + $type = shift @_; + @tests = @_; -if ($^O eq 'os2' || $^O eq 'MSWin32' || $^O eq 'qnx' || 1) { - $sharpbang = 0; -} -else { - open(CONFIG, "../config.sh"); - while () { - if (/sharpbang='(.*)'/) { - $sharpbang = ($1 eq '#!'); - last; - } - } - close(CONFIG); -} -$bad = 0; -$good = 0; -$total = @ARGV; -while ($test = shift) { - if ($test =~ /^$/) { - next; + print <<'EOT' if ($type eq 'compile'); +-------------------------------------------------------------------------------- +TESTING COMPILER +-------------------------------------------------------------------------------- +EOT + + $ENV{PERLCC_TIMEOUT} = 120 + if ($type eq 'compile' && !$ENV{PERLCC_TIMEOUT}); + + $bad = 0; + $good = 0; + $total = @tests; + $files = 0; + $totmax = 0; + $maxlen = 0; + foreach (@tests) { + $len = length; + $maxlen = $len if $len > $maxlen; } - $te = $test; - chop($te); - print "$te" . '.' x (18 - length($te)); - if ($sharpbang) { - open(results,"./$test |") || (print "can't run.\n"); - } else { - open(script,"$test") || die "Can't run $test.\n"; - $_ =