6 unless(grep /blib/, @INC) {
19 my $can_fork = $Config{d_fork} ||
20 (($^O eq 'MSWin32' || $^O eq 'NetWare') and
21 $Config{useithreads} and
22 $Config{ccflags} =~ /-DPERL_IMPLICIT_SYS/
25 if ($ENV{PERL_CORE} and $Config{'extensions'} !~ /\bIO\b/) {
26 $reason = 'IO extension unavailable';
31 elsif ($^O eq 'MSWin32' && !$ENV{TEST_IO_PIPE}) {
32 $reason = 'Win32 testing environment not set';
35 print "1..0 # Skip: $reason\n";
42 my $is_win32=$^O eq 'MSWin32' ? "MSWin32 has broken pipes" : "";
48 print "ok $_ # skipped: $is_win32\n" for 1..4;
50 $pipe = new IO::Pipe->reader($perl, '-e', 'print qq(not ok 1\n)');
55 $pipe->close or print "# \$!=$!\nnot ";
57 $cmd = 'BEGIN{$SIG{ALRM} = sub {print qq(not ok 4\n); exit}; alarm 10} s/not //';
58 $pipe = new IO::Pipe->writer($perl, '-pe', $cmd);
59 print $pipe "not ok 3\n" ;
60 $pipe->close or print "# \$!=$!\nnot ";
64 # Check if can fork with dynamic extensions (bug in CRT):
66 system "$^X -I../lib -MOpcode -e 'defined fork or die' > /dev/null 2>&1") {
67 print "ok $_ # skipped: broken fork\n" for 5..10;
86 $stdin = bless \*STDIN, "IO::Handle";
87 $stdin->fdopen($pipe,"r");
88 exec $^X, '-pne', 'tr/YX/ko/';
96 print "ok $_ # skipped: $is_win32\n" for 7..8;
115 $stdout = bless \*STDOUT, "IO::Handle";
116 $stdout->fdopen($pipe,"w");
117 print STDOUT "not ok 7\n";
118 exec 'echo', 'not ok 8';
126 print "ok $_ # skipped: $is_win32\n" for 9;
128 $pipe = new IO::Pipe;
131 $SIG{'PIPE'} = 'broken_pipe';
137 print $pipe "not ok 9\n";