summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--MANIFEST1
-rw-r--r--Makefile.SH4
-rwxr-xr-xt/TEST19
-rwxr-xr-xt/UTEST209
-rw-r--r--t/lib/charnames.t2
-rwxr-xr-xt/lib/glob-basic.t5
6 files changed, 20 insertions, 220 deletions
diff --git a/MANIFEST b/MANIFEST
index e5b55f9ab9..edc5467b99 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 37679af4ea..02612e6895 100644
--- a/Makefile.SH
+++ b/Makefile.SH
@@ -844,9 +844,9 @@ test check: test-prep
utest ucheck: test-prep
if (true </dev/tty) >/dev/null 2>&1; then \
- cd t && $(LDLIBPTH) ./perl UTEST </dev/tty; \
+ cd t && $(LDLIBPTH) ./perl TEST -utf8 </dev/tty; \
else \
- cd t && PERL_SKIP_TTY_TEST=1 $(LDLIBPTH) ./perl UTEST; \
+ cd t && PERL_SKIP_TTY_TEST=1 $(LDLIBPTH) ./perl TEST -utf8; \
fi
# For testing without a tty or controling terminal. See t/op/stat.t
diff --git a/t/TEST b/t/TEST
index 6237f9e10d..9b988b82db 100755
--- a/t/TEST
+++ b/t/TEST
@@ -1,15 +1,18 @@
#!./perl
-# 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 && $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 d1ac2be81d..0000000000
--- 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 (<CONFIG>) {
- 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";
- $_ = <SCRIPT>;
- close(SCRIPT);
- 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 = '';
- }
-
- if ($type eq 'perl') {
- my $run = "./perl$switch -I../lib -Mutf8 $test |";
- open(RESULTS, $run) or
- print "can't run '$run': $!.\n";
- }
- else {
- my $compile = "./perl -I../lib ../utils/perlcc -Mutf8 ./$test -run -verbose dcf -log ../compilelog |";
- open(RESULTS, $compile) or
- print "can't compile '$compile': $!.\n";
- }
- }
- $ok = 0;
- $next = 0;
- while (<RESULTS>) {
- if ($verbose) {
- print $_;
- }
- unless (/^#/) {
- if (/^1\.\.([0-9]+)/) {
- $max = $1;
- $totmax += $max;
- $files += 1;
- $next = 1;
- $ok = 1;
- }
- else {
- $next = $1, $ok = 0, last if /^not ok ([0-9]*)/;
- if (/^ok (\d+)(\s*#.*)?$/ && $1 == $next) {
- $next = $next + 1;
- }
- elsif (/^Bail out!\s*(.*)/i) { # magic words
- die "FAILED--Further testing stopped" . ($1 ? ": $1\n" : ".\n");
- }
- else {
- $ok = 0;
- }
- }
- }
- }
- close RESULTS;
- $next = $next - 1;
- if ($ok && $next == $max) {
- if ($max) {
- print "ok\n";
- $good = $good + 1;
- }
- else {
- print "skipping test on this platform\n";
- $files -= 1;
- }
- }
- else {
- $next += 1;
- print "FAILED at test $next\n";
- $bad = $bad + 1;
- $_ = $test;
- if (/^base/) {
- die "Failed a basic test--cannot continue.\n";
- }
- }
- }
-
- if ($bad == 0) {
- if ($ok) {
- print "All tests successful.\n";
- # XXX add mention of 'perlbug -ok' ?
- }
- else {
- die "FAILED--no tests were run for some reason.\n";
- }
- }
- else {
- $pct = sprintf("%.2f", $good / $total * 100);
- if ($bad == 1) {
- warn "Failed 1 test script out of $total, $pct% okay.\n";
- }
- else {
- warn "Failed $bad test scripts out of $total, $pct% okay.\n";
- }
- warn <<'SHRDLU';
- ### Since not all tests were successful, you may want to run some
- ### of them individually and examine any diagnostic messages they
- ### produce. See the INSTALL document's section on "make test".
- ### If you are testing the compiler, then ignore this message
- ### and run
- ### ./perl harness
- ### in the directory ./t.
-SHRDLU
- warn <<'SHRDLU' if $good / $total > 0.8;
- ###
- ### Since most tests were successful, you have a good chance to
- ### get information with better granularity by running
- ### ./perl harness
- ### in directory ./t.
-SHRDLU
- }
- ($user,$sys,$cuser,$csys) = times;
- print sprintf("u=%g s=%g cu=%g cs=%g scripts=%d tests=%d\n",
- $user,$sys,$cuser,$csys,$files,$totmax);
-}
-exit ($bad != 0);
diff --git a/t/lib/charnames.t b/t/lib/charnames.t
index d00396fb4a..388f533f13 100644
--- a/t/lib/charnames.t
+++ b/t/lib/charnames.t
@@ -16,7 +16,7 @@ print "not " unless "Here\N{EXCLAMATION MARK}?" eq "Here\041?";
print "ok 1\n";
{
- use bytes; # UTEST can switch utf8 on
+ use bytes; # TEST -utf8 can switch utf8 on
print "# \$res=$res \$\@='$@'\nnot "
if $res = eval <<'EOE'
diff --git a/t/lib/glob-basic.t b/t/lib/glob-basic.t
index e8a2905add..8cc072a68f 100755
--- a/t/lib/glob-basic.t
+++ b/t/lib/glob-basic.t
@@ -101,6 +101,11 @@ print "ok 7\n";
'{TES*,doesntexist*,a,b}',
GLOB_BRACE | GLOB_NOMAGIC | ($^O eq 'VMS' ? GLOB_NOCASE : 0)
);
+
+# Working on t/TEST often causes this test to fail because it sees temp
+# and RCS files. Filter them out.
+@a = grep !/(,v$|~$)/, @a;
+
unless (@a == 3
and $a[0] eq ($^O eq 'VMS'? 'test.' : 'TEST')
and $a[1] eq 'a'