summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2004-03-02 22:02:36 +0000
committerNicholas Clark <nick@ccl4.org>2004-03-02 22:02:36 +0000
commit43651d81392f71a2868d35b75782d354b0139c90 (patch)
tree7867f13e33750fe244b05a78c9455989b9214006 /t
parent9acd3e2cb8772b6eb8d3f739a8401e73420609ba (diff)
downloadperl-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')
-rwxr-xr-xt/TEST1
-rw-r--r--t/io/binmode.t6
-rw-r--r--t/io/crlf.t6
-rw-r--r--t/io/layers.t2
-rwxr-xr-xt/io/open.t8
-rwxr-xr-xt/io/print.t5
-rwxr-xr-xt/io/read.t3
-rwxr-xr-xt/op/magic.t38
8 files changed, 44 insertions, 25 deletions
diff --git a/t/TEST b/t/TEST
index 7ff34b2a7c..5d5727ad05 100755
--- a/t/TEST
+++ b/t/TEST
@@ -24,6 +24,7 @@ if ($#ARGV >= 0) {
$bytecompile = 1 if $1 eq 'bytecompile';
$compile = 1 if $1 eq 'compile';
$taintwarn = 1 if $1 eq 'taintwarn';
+ $ENV{PERL_CORE_MINITEST} = 1 if $1 eq 'minitest';
if ($1 =~ /^deparse(,.+)?$/) {
$deparse = 1;
$deparse_opts = $1;
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;
diff --git a/t/op/magic.t b/t/op/magic.t
index 7a932818bf..04cf718ead 100755
--- a/t/op/magic.t
+++ b/t/op/magic.t
@@ -38,14 +38,15 @@ sub skip {
print "1..53\n";
-$Is_MSWin32 = $^O eq 'MSWin32';
-$Is_NetWare = $^O eq 'NetWare';
-$Is_VMS = $^O eq 'VMS';
-$Is_Dos = $^O eq 'dos';
-$Is_os2 = $^O eq 'os2';
-$Is_Cygwin = $^O eq 'cygwin';
-$Is_MacOS = $^O eq 'MacOS';
-$Is_MPE = $^O eq 'mpeix';
+$Is_MSWin32 = $^O eq 'MSWin32';
+$Is_NetWare = $^O eq 'NetWare';
+$Is_VMS = $^O eq 'VMS';
+$Is_Dos = $^O eq 'dos';
+$Is_os2 = $^O eq 'os2';
+$Is_Cygwin = $^O eq 'cygwin';
+$Is_MacOS = $^O eq 'MacOS';
+$Is_MPE = $^O eq 'mpeix';
+$Is_miniperl = $ENV{PERL_CORE_MINITEST};
$PERL = ($Is_NetWare ? 'perl' :
($Is_MacOS || $Is_VMS) ? $^X :
@@ -347,7 +348,9 @@ else {
skip('no caseless %ENV support') for 1..4;
}
-{
+if ($Is_miniperl) {
+ skip ("miniperl can't rely on loading %Errno");
+} else {
no warnings 'void';
# Make sure Errno hasn't been prematurely autoloaded
@@ -362,15 +365,18 @@ else {
}, $@;
}
+if ($Is_miniperl) {
+ skip ("miniperl can't rely on loading %Errno");
+} else {
+ # Make sure that Errno loading doesn't clobber $!
-# Make sure that Errno loading doesn't clobber $!
-
-undef %Errno::;
-delete $INC{"Errno.pm"};
+ undef %Errno::;
+ delete $INC{"Errno.pm"};
-open(FOO, "nonesuch"); # Generate ENOENT
-my %errs = %{"!"}; # Cause Errno.pm to be loaded at run-time
-ok ${"!"}{ENOENT};
+ open(FOO, "nonesuch"); # Generate ENOENT
+ my %errs = %{"!"}; # Cause Errno.pm to be loaded at run-time
+ ok ${"!"}{ENOENT};
+}
ok $^S == 0 && defined $^S;
eval { ok $^S == 1 };