From: Michael G. Schwern Date: Sat, 17 Feb 2001 22:44:44 +0000 (-0500) Subject: Re: Why t/TEST and not Test::Harness? X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5d9a640495c9fba008f523d6f54b66106ead4d0f;p=p5sagit%2Fp5-mst-13.2.git Re: Why t/TEST and not Test::Harness? Message-ID: <20010217224444.A6679@magnonel.guild.net> Replace UTEST with TEST -utf8. p4raw-id: //depot/perl@8821 --- diff --git a/MANIFEST b/MANIFEST index e5b55f9..edc5467 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1331,7 +1331,6 @@ sv.c Scalar value code sv.h Scalar value header t/README Instructions for regression tests t/TEST The regression tester -t/UTEST Run regression tests with -Mutf8 t/base/commonsense.t See if configuration meets basic needs t/base/cond.t See if conditionals work t/base/if.t See if if works diff --git a/Makefile.SH b/Makefile.SH index 37679af..02612e6 100644 --- a/Makefile.SH +++ b/Makefile.SH @@ -844,9 +844,9 @@ test check: test-prep utest ucheck: test-prep if (true /dev/null 2>&1; then \ - cd t && $(LDLIBPTH) ./perl UTEST = 0 && $ARGV[0] eq '-v') { - $verbose = 1; - shift; +# Cheesy version of Getopt::Std. Maybe we should replace it with that. +if ($#ARGV >= 0) { + foreach my $idx (0..$#ARGV) { + next unless $ARGV[$idx] =~ /^-(\w+)$/; + $verbose = 1 if $1 eq 'v'; + $with_utf= 1 if $1 eq 'utf8'; + splice(@ARGV, $idx, 1); + } } chdir 't' if -f 't/TEST'; @@ -86,13 +89,15 @@ EOT $switch = ''; } + my $utf = $with_utf ? '-I../lib -Mutf8' + : ''; if ($type eq 'perl') { - my $run = "./perl$switch $test |"; + my $run = "./perl$switch $utf $test |"; open(RESULTS,$run) or print "can't run '$run': $!.\n"; } else { my $compile = - "./perl -I../lib ../utils/perlcc -o ./$test.plc ./$test " + "./perl -I../lib ../utils/perlcc -o ./$test.plc $utf ./$test " ." && ./$test.plc |"; open(RESULTS, $compile) or print "can't compile '$compile': $!.\n"; diff --git a/t/UTEST b/t/UTEST deleted file mode 100755 index d1ac2be..0000000 --- a/t/UTEST +++ /dev/null @@ -1,209 +0,0 @@ -#!./perl - -# Last change: Fri Jan 10 09:57:03 WET 1997 - -# 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 && $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" - unless -e 'perl' or -e 'perl.exe'; - -#$ENV{PERL_DESTRUCT_LEVEL} = '2'; -$ENV{EMXSHELL} = 'sh'; # For OS/2 - -if ($#ARGV == -1) { - @ARGV = split(/[ \n]/, - `echo base/*.t comp/*.t cmd/*.t io/*.t; echo op/*.t pragma/*.t lib/*.t`); -} - -if ($^O eq 'os2' || $^O eq 'qnx') { - $sharpbang = 0; -} -else { - open(CONFIG, "../config.sh"); - while () { - if (/sharpbang='(.*)'/) { - $sharpbang = ($1 eq '#!'); - last; - } - } - close(CONFIG); -} - -%infinite = ( 'comp/require.t', 1, 'op/bop.t', 1, 'lib/hostname.t', 1 ); - -_testprogs('perl', @ARGV); -_testprogs('compile', @ARGV) if (-e "../testcompile"); - -sub _testprogs { - $type = shift @_; - @tests = @_; - - - 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; - while ($test = shift @tests) { - - if ( $infinite{$test} && $type eq 'compile' ) { - print STDERR "$test creates infinite loop! Skipping.\n"; - next; - } - if ($test =~ /^$/) { - next; - } - $te = $test; - chop($te); - print "$te" . '.' x (18 - length($te)); - if (0) { - -x $test || (print "isn't executable.\n"); - - if ($type eq 'perl') { - my $run = "./$test |"; - open(RESULTS, $run) || (print "can't run '$run': $!\n"); - } - else { - my $compile = - "./perl -I../lib ../utils/perlcc -o ./$test.plc ./$test " - ." && ./$test.plc |"; - open(RESULTS, $compile) - or print "can't compile '$compile': $!.\n"; - unlink "./$test.plc"; - } - } - else { - open(SCRIPT,"$test") or die "Can't run $test.\n"; - $_ =