From: Abe Timmerman Date: Thu, 15 Mar 2007 18:06:25 +0000 (+0100) Subject: Re: Smoke [5.8.8] 30522 FAIL(XF) Solaris 2.10 (i386/1 cpu) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=240b676612359dc858a2fba0a01262d0ee466078;p=p5sagit%2Fp5-mst-13.2.git Re: Smoke [5.8.8] 30522 FAIL(XF) Solaris 2.10 (i386/1 cpu) Message-ID: <45F97D11.2080009@ztreet.demon.nl> skips some tests when perl is built without useperlio p4raw-id: //depot/perl@30600 --- diff --git a/ext/PerlIO/encoding/t/nolooping.t b/ext/PerlIO/encoding/t/nolooping.t index 846a248..4acb0f5 100644 --- a/ext/PerlIO/encoding/t/nolooping.t +++ b/ext/PerlIO/encoding/t/nolooping.t @@ -8,7 +8,11 @@ BEGIN { } } -use Test::More tests => 1; +use Config; + +use Test::More $Config{useperlio} + ? (tests => 1) + : (skip_all => 'No PerlIO enabled'); BEGIN { $SIG{__WARN__} = sub { $warn .= $_[0] }; diff --git a/t/op/inccode.t b/t/op/inccode.t index 268d4f4..9457226 100644 --- a/t/op/inccode.t +++ b/t/op/inccode.t @@ -2,8 +2,11 @@ # Tests for the coderef-in-@INC feature -my $can_fork = 0; -my $minitest = $ENV{PERL_CORE_MINITEST}; +use Config; + +my $can_fork = 0; +my $minitest = $ENV{PERL_CORE_MINITEST}; +my $has_perlio = $Config{useperlio}; BEGIN { chdir 't' if -d 't'; @@ -11,9 +14,7 @@ BEGIN { } if (!$minitest) { - use Config; - if (PerlIO::Layer->find('perlio') && $Config{d_fork} && - eval 'require POSIX; 1') { + if ($Config{d_fork} && eval 'require POSIX; 1') { $can_fork = 1; } } @@ -212,27 +213,32 @@ is( $ret, 'abc', 'do "abc.pl" sees return value' ); exit if $minitest; -pop @INC; +SKIP: { + skip( "No PerlIO available", 3 ) unless $has_perlio; + pop @INC; -push @INC, sub { - my ($cr, $filename) = @_; - my $module = $filename; $module =~ s,/,::,g; $module =~ s/\.pm$//; - open my $fh, '<', \"package $module; sub complain { warn q() }; \$::file = __FILE__;" - or die $!; - $INC{$filename} = "/custom/path/to/$filename"; - return $fh; -}; + push @INC, sub { + my ($cr, $filename) = @_; + my $module = $filename; $module =~ s,/,::,g; $module =~ s/\.pm$//; + open my $fh, '<', + \"package $module; sub complain { warn q() }; \$::file = __FILE__;" + or die $!; + $INC{$filename} = "/custom/path/to/$filename"; + return $fh; + }; -require Publius::Vergilius::Maro; -is( $INC{'Publius/Vergilius/Maro.pm'}, '/custom/path/to/Publius/Vergilius/Maro.pm', '%INC set correctly'); -is( our $file, '/custom/path/to/Publius/Vergilius/Maro.pm', '__FILE__ set correctly' ); -{ - my $warning; - local $SIG{__WARN__} = sub { $warning = shift }; - Publius::Vergilius::Maro::complain(); - like( $warning, qr{something's wrong at /custom/path/to/Publius/Vergilius/Maro.pm}, 'warn() reports correct file source' ); + require Publius::Vergilius::Maro; + is( $INC{'Publius/Vergilius/Maro.pm'}, + '/custom/path/to/Publius/Vergilius/Maro.pm', '%INC set correctly'); + is( our $file, '/custom/path/to/Publius/Vergilius/Maro.pm', + '__FILE__ set correctly' ); + { + my $warning; + local $SIG{__WARN__} = sub { $warning = shift }; + Publius::Vergilius::Maro::complain(); + like( $warning, qr{something's wrong at /custom/path/to/Publius/Vergilius/Maro.pm}, 'warn() reports correct file source' ); + } } - pop @INC; if ($can_fork) {