diff options
author | Radu Greab <radu@netsoft.ro> | 2001-01-05 04:29:06 +0200 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-01-05 01:11:29 +0000 |
commit | f5cf745e299cac34ef186d2d2d056e876998ccb2 (patch) | |
tree | d6839726bc0f7353db88e2769129bd526e567055 /lib/Test | |
parent | 57aa58c00eb1148db70ab5b5e5680ea6be124cbe (diff) | |
download | perl-f5cf745e299cac34ef186d2d2d056e876998ccb2.tar.gz |
Test::Harness doesn't use IO (was Re: [PATCH 5.7.0] Re: Tests depending on extensions, and `make minitest')
Message-ID: <14933.5458.672637.641215@ix.netsoft.ro>
Cleans up Harness to not use FileHandle, which uses IO.
p4raw-id: //depot/perl@8327
Diffstat (limited to 'lib/Test')
-rw-r--r-- | lib/Test/Harness.pm | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/Test/Harness.pm b/lib/Test/Harness.pm index febc4fc8d0..ec6b9588ce 100644 --- a/lib/Test/Harness.pm +++ b/lib/Test/Harness.pm @@ -5,14 +5,13 @@ use 5.005_64; use Exporter; use Benchmark; use Config; -use FileHandle; use strict; our($VERSION, $verbose, $switches, $have_devel_corestack, $curtest, $columns, @ISA, @EXPORT, @EXPORT_OK); $have_devel_corestack = 0; -$VERSION = "1.1606"; +$VERSION = "1.1607"; $ENV{HARNESS_ACTIVE} = 1; @@ -74,21 +73,20 @@ sub runtests { $ml = "\r$blank\r$leader" if -t STDOUT and not $ENV{HARNESS_NOTTY} and not $verbose; print $leader; - my $fh = new FileHandle; - $fh->open($test) or print "can't open $test. $!\n"; + open(my $fh, $test) or print "can't open $test. $!\n"; my $first = <$fh>; my $s = $switches; $s .= " $ENV{'HARNESS_PERL_SWITCHES'}" if exists $ENV{'HARNESS_PERL_SWITCHES'}; $s .= join " ", q[ "-T"], map {qq["-I$_"]} @INC if $first =~ /^#!.*\bperl.*-\w*T/; - $fh->close or print "can't close $test. $!\n"; + close($fh) or print "can't close $test. $!\n"; my $cmd = ($ENV{'HARNESS_COMPILE_TEST'}) ? "./perl -I../lib ../utils/perlcc $test " . "-run 2>> ./compilelog |" : "$^X $s $test|"; $cmd = "MCR $cmd" if $^O eq 'VMS'; - $fh->open($cmd) or print "can't run $test. $!\n"; + open($fh, $cmd) or print "can't run $test. $!\n"; $ok = $next = $max = 0; @failed = (); my %todo = (); @@ -163,7 +161,7 @@ sub runtests { die "FAILED--Further testing stopped" . ($1 ? ": $1\n" : ".\n"); } } - $fh->close; # must close to reap child resource values + close($fh); # must close to reap child resource values my $wstatus = $ignore_exitcode ? 0 : $?; # Can trust $? ? my $estatus; $estatus = ($^O eq 'VMS' |