From: Radu Greab Date: Fri, 5 Jan 2001 02:29:06 +0000 (+0200) Subject: Test::Harness doesn't use IO (was Re: [PATCH 5.7.0] Re: Tests depending on extensions... X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f5cf745e299cac34ef186d2d2d056e876998ccb2;p=p5sagit%2Fp5-mst-13.2.git 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 --- diff --git a/lib/Test/Harness.pm b/lib/Test/Harness.pm index febc4fc..ec6b958 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 9503ea7..2209baa0 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 2e45586..bc3845c 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