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 | |
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
-rw-r--r-- | lib/Test/Harness.pm | 12 | ||||
-rwxr-xr-x | t/lib/ftmp-mktemp.t | 1 | ||||
-rwxr-xr-x | t/lib/ftmp-posix.t | 2 |
3 files changed, 8 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' diff --git a/t/lib/ftmp-mktemp.t b/t/lib/ftmp-mktemp.t index 9503ea7585..2209baa025 100755 --- a/t/lib/ftmp-mktemp.t +++ b/t/lib/ftmp-mktemp.t @@ -15,6 +15,7 @@ use strict; use File::Spec; use File::Path; use File::Temp qw/ :mktemp unlink0 /; +use FileHandle; ok(1); diff --git a/t/lib/ftmp-posix.t b/t/lib/ftmp-posix.t index 2e455861e9..bc3845c22b 100755 --- a/t/lib/ftmp-posix.t +++ b/t/lib/ftmp-posix.t @@ -11,6 +11,8 @@ BEGIN { use strict; use File::Temp qw/ :POSIX unlink0 /; +use FileHandle; + ok(1); # TMPNAM - scalar |