From: Jarkko Hietaniemi Date: Mon, 8 Sep 2003 18:42:43 +0000 (+0000) Subject: Try to make the de0.t test more robust. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f9b042224b842cb63aa7077a1899ac8227db5ee4;p=p5sagit%2Fp5-mst-13.2.git Try to make the de0.t test more robust. The test is so flakey (too many external things influencing the result) that I'm likely to leave it out from the maint. p4raw-id: //depot/perl@21097 --- diff --git a/lib/perl5db/de0.t b/lib/perl5db/de0.t index 989c92e..80dd710 100644 --- a/lib/perl5db/de0.t +++ b/lib/perl5db/de0.t @@ -2,13 +2,14 @@ BEGIN { chdir 't' if -d 't'; - @INC = '../lib'; + @INC = qw(. ../lib); require Config; import Config; if ($^O eq 'VMS') { print "1..0 # skip on $^O, no piped open\n"; exit 0; } $ENV{PERL5LIB} = '../lib'; # so children will see it too + require 'test.pl'; } use strict; @@ -25,26 +26,28 @@ my @prgs; close DATA; } -use Test::More; - plan tests => scalar @prgs; require "dumpvar.pl"; $ENV{PERLDB_OPTS} = "TTY=0"; my($ornament1,$ornament2,$wtrfh,$rdrfh); -open3 $wtrfh, $rdrfh, 0, $^X, "-de0"; +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; - while ($ios->can_read(0.25)) { - last unless sysread $rdrfh, $got, 1024, length($got); + for my $try (1..3) { + if ($ios->can_read(0.25)) { + sysread $rdrfh, $got, 1024, length($got); + select undef, undef, undef, 0.25; + } } SKIP: { - skip("failed to read debugger", 1) unless defined $got; + 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?//; unless (defined $ornament1) { $got =~ s/^\s*Loading.*\r?\n?Editor.*\r?\n?\r?\n?Enter.*\r?\n?\r?\n?main::\(-e:1\):\s+0\r?\n?//;