From: Jarkko Hietaniemi Date: Mon, 8 Sep 2003 19:06:09 +0000 (+0000) Subject: The IPC::Open3 is just too unreliable for this task. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=517a9ec8f1a39cca48e8724af1644a3ae3826660;p=p5sagit%2Fp5-mst-13.2.git The IPC::Open3 is just too unreliable for this task. p4raw-id: //depot/perl@21098 --- diff --git a/lib/perl5db/de0.t b/lib/perl5db/de0.t index 80dd710..d468a92 100644 --- a/lib/perl5db/de0.t +++ b/lib/perl5db/de0.t @@ -13,10 +13,8 @@ BEGIN { } use strict; -use IPC::Open3 qw(open3); -use IO::Select; -$|=1; +$| = 1; my @prgs; @@ -30,22 +28,17 @@ plan tests => scalar @prgs; require "dumpvar.pl"; +END { 1 while unlink "de0.out" } + $ENV{PERLDB_OPTS} = "TTY=0"; -my($ornament1,$ornament2,$wtrfh,$rdrfh); +my ($ornament1, $ornament2); my $Perl = which_perl(); -open3 $wtrfh, $rdrfh, 0, $Perl, "-de0" or die; -my $ios = IO::Select->new(); -$ios->add($rdrfh); for (@prgs){ - my($prog,$expected) = split(/\nEXPECT\n?/, $_); - print $wtrfh $prog, "\n"; - my $got; - for my $try (1..3) { - if ($ios->can_read(0.25)) { - sysread $rdrfh, $got, 1024, length($got); - select undef, undef, undef, 0.25; - } - } + my($prog, $expected) = split(/\nEXPECT\n?/, $_); + open my $debug, qq{| $Perl "-de0" 2>de0.out} or die; + print $debug $prog, "\n"; + close $debug; + my $got = do { local $/; open my $fh, "de0.out" or die; <$fh> }; SKIP: { skip("failed to read debugger", 1) unless defined $got && length $got; $got =~ s/^\s*Loading.*\r?\n?Editor.*\r?\n?\r?\n?Enter.*\r?\n?\r?\n?main::\(-e:1\):\s+0\r?\n?//;