diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2003-09-08 18:42:43 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2003-09-08 18:42:43 +0000 |
commit | f9b042224b842cb63aa7077a1899ac8227db5ee4 (patch) | |
tree | 6af0aa974d10372fa1e0b113c927ee6d6ebf6e43 /lib/perl5db | |
parent | e67b9e528630fa842f677b067da8b404fc3914ab (diff) | |
download | perl-f9b042224b842cb63aa7077a1899ac8227db5ee4.tar.gz |
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
Diffstat (limited to 'lib/perl5db')
-rw-r--r-- | lib/perl5db/de0.t | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/lib/perl5db/de0.t b/lib/perl5db/de0.t index 989c92e56e..80dd710178 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?//; |