diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1998-05-14 22:24:26 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1998-05-14 22:24:26 +0000 |
commit | 6ee623d521a149edc6574c512fa951a192cd086a (patch) | |
tree | 3d769839caf246d24053d0f49b4f48aed590e031 /t | |
parent | 20408e3ccf502b6ce4033d8203710405ec9ef8f6 (diff) | |
download | perl-6ee623d521a149edc6574c512fa951a192cd086a.tar.gz |
[win32] integrate mainline
p4raw-id: //depot/win32/perl@973
Diffstat (limited to 't')
-rwxr-xr-x | t/TEST | 61 | ||||
-rw-r--r-- | t/harness | 13 | ||||
-rwxr-xr-x | t/io/pipe.t | 3 | ||||
-rwxr-xr-x | t/lib/anydbm.t | 6 |
4 files changed, 70 insertions, 13 deletions
@@ -38,12 +38,34 @@ else { close(CONFIG); } -$bad = 0; -$good = 0; -$total = @ARGV; -$files = 0; -$totmax = 0; -while ($test = shift) { +%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 " +-------------------------------------------------------------------------------- +TESTING COMPILER +-------------------------------------------------------------------------------- +" if ($type eq 'compile'); + + $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; } @@ -52,7 +74,14 @@ while ($test = shift) { print "$te" . '.' x (18 - length($te)); if ($sharpbang) { -x $test || (print "isn't executable.\n"); - open(RESULTS,"./$test |") || (print "can't run.\n"); + + if ($type eq 'perl') + { open(RESULTS, "./$test |") || (print "can't run.\n"); } + else + { + open(RESULTS, "./perl -I../lib ../utils/perlcc ./$test -run -verbose dcf -log ../compilelog |") + || (print "can't compile.\n"); + } } else { open(SCRIPT,"$test") || die "Can't run $test.\n"; $_ = <SCRIPT>; @@ -66,7 +95,16 @@ while ($test = shift) { } else { $switch = ''; } - open(RESULTS,"./perl$switch $test |") || (print "can't run.\n"); + + if ($type eq 'perl') + { + open(RESULTS,"./perl$switch $test |") || (print "can't run.\n"); + } + else + { + open(RESULTS, "./perl -I../lib ../utils/perlcc ./$test -run -verbose dcf -log ../compilelog |") + || (print "can't compile.\n"); + } } $ok = 0; $next = 0; @@ -129,16 +167,21 @@ if ($bad == 0) { ### 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 + ### ./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); @@ -17,4 +17,17 @@ $Test::Harness::verbose = shift if @ARGV && $ARGV[0] eq '-v'; @tests = @ARGV; @tests = <base/*.t comp/*.t cmd/*.t io/*.t op/*.t pragma/*.t lib/*.t> unless @tests; + Test::Harness::runtests @tests; + +%infinite = ('comp/require.t', 1, 'op/bop.t', 1, 'lib/hostname.t', 1 ); + +@tests = grep (!$infinite{$_}, @tests); + +if (-e "../testcompile") +{ + print "The tests ", join(' ', keys(%infinite)), + " generate infinite loops! Skipping!\n"; + + $ENV{'COMPILE_TEST'} = 1; Test::Harness::runtests @tests; +} diff --git a/t/io/pipe.t b/t/io/pipe.t index efeda80551..0387e556ca 100755 --- a/t/io/pipe.t +++ b/t/io/pipe.t @@ -74,10 +74,11 @@ if ($^O eq 'VMS') { exit; } -if ($Config{d_sfio} || $^O eq machten) { +if ($Config{d_sfio} || $^O eq machten || $^O eq beos) { # Sfio doesn't report failure when closing a broken pipe # that has pending output. Go figure. MachTen doesn't either, # but won't write to broken pipes, so nothing's pending at close. + # BeOS will not write to broken pipes, either. print "ok 9\n"; } else { diff --git a/t/lib/anydbm.t b/t/lib/anydbm.t index 3ab609cecc..0391b7b490 100755 --- a/t/lib/anydbm.t +++ b/t/lib/anydbm.t @@ -12,7 +12,7 @@ use Fcntl; print "1..12\n"; -unlink <Op_dbmx.*>; +unlink <Op_dbmx*>; umask(0); print (tie(%h,AnyDBM_File,'Op_dbmx', O_RDWR|O_CREAT, 0640) @@ -20,7 +20,7 @@ print (tie(%h,AnyDBM_File,'Op_dbmx', O_RDWR|O_CREAT, 0640) $Dfile = "Op_dbmx.pag"; if (! -e $Dfile) { - ($Dfile) = <Op_dbmx.*>; + ($Dfile) = <Op_dbmx*>; } if ($^O eq 'amigaos' || $^O eq 'os2' || $^O eq 'MSWin32' || $^O eq 'dos') { print "ok 2 # Skipped: different file permission semantics\n"; @@ -33,7 +33,7 @@ else { while (($key,$value) = each(%h)) { $i++; } -print (!$i ? "ok 3\n" : "not ok 3\n"); +print (!$i ? "ok 3\n" : "not ok 3 # i=$i\n\n"); $h{'goner1'} = 'snork'; |