summaryrefslogtreecommitdiff
path: root/lib/perl5db
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2003-09-08 09:52:40 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2003-09-08 09:52:40 +0000
commit3379a47e6a8a8a29a0a7b78ef4b6e654f17d10e1 (patch)
treed0d56ff185b74d33f3545b1b20bca79ef6c10283 /lib/perl5db
parent1d8663a3de8493970219ce238d848787b038398b (diff)
downloadperl-3379a47e6a8a8a29a0a7b78ef4b6e654f17d10e1.tar.gz
In Win32 IPC::Open3 + IO::Select does not work that well
so mostly undo the change #21072 and revert back to using a temp file. p4raw-link: @21072 on //depot/perl: cc5fd0943567be6ee0408b6bc088cce15ca15861 p4raw-id: //depot/perl@21080
Diffstat (limited to 'lib/perl5db')
-rw-r--r--lib/perl5db/de0.t38
1 files changed, 16 insertions, 22 deletions
diff --git a/lib/perl5db/de0.t b/lib/perl5db/de0.t
index 400b1f4c0a..116bbaac61 100644
--- a/lib/perl5db/de0.t
+++ b/lib/perl5db/de0.t
@@ -3,19 +3,16 @@
BEGIN {
chdir 't' if -d 't';
@INC = '../lib';
- require Config; import Config;
- unless ($Config{d_fork}) {
- print "1..0 # no fork\n";
+ $ENV{PERL5LIB} = '../lib'; # so children will see it too
+ 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
}
use strict;
-use IPC::Open3 qw(open3);
-use IO::Select;
-$|=1;
+$| = 1;
my @prgs;
@@ -31,25 +28,22 @@ plan tests => scalar @prgs;
require "dumpvar.pl";
+use File::Temp qw/tempfile/;
+
+our ($tmpfh, $tmpfile) = tempfile();
+
$ENV{PERLDB_OPTS} = "TTY=0";
-my($ornament1,$ornament2,$wtrfh,$rdrfh);
-open3 $wtrfh, $rdrfh, 0, $^X, "-de0";
-my $ios = IO::Select->new();
-$ios->add($rdrfh);
+my($ornament1,$ornament2);
for (@prgs){
- my($prog,$expected) = split(/\nEXPECT\n?/, $_);
- print $wtrfh $prog, "\n";
- my $got;
- while (not defined $got) {
- while ($ios->can_read(0.25)) {
- sysread $rdrfh, $got, 1024, length($got);
- }
- }
+ my($prog, $expected) = split(/\nEXPECT\n?/, $_);
+ open my $select, "| $^X -de0 2> $tmpfile" or die $!;
+ print $select $prog;
+ close $select;
+ my $got = do { open my($fh), $tmpfile or die; local $/; <$fh>; };
$got =~ s/^\s*Loading.*\nEditor.*\n\nEnter.*\n\nmain::\(-e:1\):\s0\n//;
unless (defined $ornament1) {
- $got =~ s/^\s*Loading.*\nEditor.*\n\nEnter.*\n\nmain::\(-e:1\):\s0\n//;
- ($ornament1,$ornament2) = $got =~
- /(.*?)0\s+'reserved example for calibrating the ornaments'\n(.*)/
+ ($ornament1, $ornament2) = $got =~
+ /(.*?)0\s+'reserved example for calibrating the ornaments'\n(.*)/
}
$got =~ s/^\Q$ornament1\E//;
$got =~ s/\Q$ornament2\E\z//;