From: Craig A. Berry Date: Sun, 11 Oct 2009 22:56:23 +0000 (-0500) Subject: Try for smarter (more portable) skip criteria in Encode's piconv.t. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1518db6963d5c7acceca6dace1d6fcc78cf3aa37;p=p5sagit%2Fp5-mst-13.2.git Try for smarter (more portable) skip criteria in Encode's piconv.t. We already differ from upstream, which skips when PERL_CORE is set. Since we apparently think we can run it in core now, it seems like we ought to sort out the proper skip criteria before sending it upstream. --- diff --git a/cpan/Encode/t/piconv.t b/cpan/Encode/t/piconv.t index d97bb28..b24d753 100644 --- a/cpan/Encode/t/piconv.t +++ b/cpan/Encode/t/piconv.t @@ -3,17 +3,18 @@ # use strict; +use Config; use FindBin; use File::Spec; use IPC::Open3 qw(open3); use IO::Select; use Test::More; -my $WIN = $^O eq 'MSWin32'; +my $nofork = ! $Config{d_fork}; -if ($WIN) { +if ($nofork) { eval { require IPC::Run; IPC::Run->VERSION(0.83); 1; } or - plan skip_all => 'Win32 environments require IPC::Run 0.83 to complete this test'; + plan skip_all => 'Without fork(), we require IPC::Run 0.83 to complete this test'; } sub run_cmd (;$$); @@ -29,7 +30,7 @@ plan tests => 5; { my ( $st, $out, $err ) = run_cmd; is( $st, 0, 'status for usage call' ); - is( $out, $WIN ? undef : '' ); + is( $out, $nofork ? undef : '' ); like( $err, qr{^piconv}, 'usage' ); } @@ -51,7 +52,7 @@ sub run_cmd (;$$) { my $err = "x" x 10_000; $err = ""; - if ($WIN) { + if ($nofork) { IPC::Run->import(qw(run timeout)); my @cmd; if (defined $args) {