diff options
author | Nicholas Clark <nick@ccl4.org> | 2004-03-02 22:02:36 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2004-03-02 22:02:36 +0000 |
commit | 43651d81392f71a2868d35b75782d354b0139c90 (patch) | |
tree | 7867f13e33750fe244b05a78c9455989b9214006 /t/io | |
parent | 9acd3e2cb8772b6eb8d3f739a8401e73420609ba (diff) | |
download | perl-43651d81392f71a2868d35b75782d354b0139c90.tar.gz |
Work on eliminating systematic failures on make minitest:
make minitest passes a -minitest flag to t/TEST
t/TEST sees this and sets $ENV{PERL_CORE_MINITEST}
Tests can choose to skip based on this.
(Other tactic is to make loading of Errno by %! happen at run time.)
p4raw-id: //depot/perl@22423
Diffstat (limited to 't/io')
-rw-r--r-- | t/io/binmode.t | 6 | ||||
-rw-r--r-- | t/io/crlf.t | 6 | ||||
-rw-r--r-- | t/io/layers.t | 2 | ||||
-rwxr-xr-x | t/io/open.t | 8 | ||||
-rwxr-xr-x | t/io/print.t | 5 | ||||
-rwxr-xr-x | t/io/read.t | 3 |
6 files changed, 21 insertions, 9 deletions
diff --git a/t/io/binmode.t b/t/io/binmode.t index f50d0f7fa8..be198ae645 100644 --- a/t/io/binmode.t +++ b/t/io/binmode.t @@ -7,8 +7,9 @@ BEGIN { } use Config; -use Errno; - +BEGIN { + eval {require Errno; Errno->import;}; +} plan(tests => 9); ok( binmode(STDERR), 'STDERR made binary' ); @@ -31,6 +32,7 @@ ok( binmode(STDOUT, ":raw"), ' raw' ); ok( binmode(STDOUT, ":crlf"), ' and crlf' ); SKIP: { + skip "minitest", 1 if $ENV{PERL_CORE_MINITEST}; skip "no EBADF", 1 if (!exists &Errno::EBADF); no warnings 'io'; diff --git a/t/io/crlf.t b/t/io/crlf.t index 2ee7b83191..d6f3fc3925 100644 --- a/t/io/crlf.t +++ b/t/io/crlf.t @@ -32,9 +32,9 @@ if (find PerlIO::Layer 'perlio') { SKIP: { - eval 'use PerlIO::scalar'; - skip(q/miniperl cannnot load PerlIO::scalar/) - if $@ =~ /dynamic loading not available/; + skip("miniperl can't rely on loading PerlIO::scalar") + if $ENV{PERL_CORE_MINITEST}; + eval 'PerlIO::scalar'; my $fcontents = join "", map {"$_\015\012"} "a".."zzz"; open my $fh, "<:crlf", \$fcontents; local $/ = "xxx"; diff --git a/t/io/layers.t b/t/io/layers.t index 904ef93fa2..d0e37a3c8d 100644 --- a/t/io/layers.t +++ b/t/io/layers.t @@ -44,8 +44,10 @@ print <<__EOH__; __EOH__ SKIP: { + # FIXME - more of these could be tested without Encode or full perl skip("This perl does not have Encode", $NTEST) unless " $Config{extensions} " =~ / Encode /; + skip("miniperl does not have Encode", $NTEST) if $ENV{PERL_CORE_MINITEST}; sub check { my ($result, $expected, $id) = @_; diff --git a/t/io/open.t b/t/io/open.t index e71d2ec3c5..82ac2f3aaa 100755 --- a/t/io/open.t +++ b/t/io/open.t @@ -239,10 +239,14 @@ like( $@, qr/Bad filehandle:\s+afile/, ' right error' ); SKIP: { skip "This perl uses perlio", 1 if $Config{useperlio}; - skip "This system doesn't understand EINVAL", 1 unless exists $!{EINVAL}; + skip "miniperl cannot be relied on to load %Errno" + if $ENV{PERL_CORE_MINITEST}; + # Force the reference to %! to be run time by writing ! as {"!"} + skip "This system doesn't understand EINVAL", 1 + unless exists ${"!"}{EINVAL}; no warnings 'io'; - ok( !open(F,'>',\my $s) && $!{EINVAL}, 'open(reference) raises EINVAL' ); + ok(!open(F,'>',\my $s) && ${"!"}{EINVAL}, 'open(reference) raises EINVAL'); } { diff --git a/t/io/print.t b/t/io/print.t index f33aa666a3..31d559aac9 100755 --- a/t/io/print.t +++ b/t/io/print.t @@ -6,7 +6,8 @@ BEGIN { } use strict 'vars'; -use Errno; +eval 'use Errno'; +die $@ if $@ and !$ENV{PERL_CORE_MINITEST}; print "1..19\n"; @@ -41,6 +42,8 @@ print @x,"14\nok",@y; print ""; } +$\ = ''; + if (!exists &Errno::EBADF) { print "ok 19 # skipped: no EBADF\n"; } else { diff --git a/t/io/read.t b/t/io/read.t index ea2672dedb..63ffee1d5a 100755 --- a/t/io/read.t +++ b/t/io/read.t @@ -9,7 +9,8 @@ BEGIN { } use strict; -use Errno; +eval 'use Errno'; +die $@ if $@ and !$ENV{PERL_CORE_MINITEST}; plan tests => 2; |