summaryrefslogtreecommitdiff
path: root/t/lib/open2.t
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1998-06-15 04:07:18 +0000
committerGurusamy Sarathy <gsar@cpan.org>1998-06-15 04:07:18 +0000
commitf55ee38a033ce570145fdd38bb9f09acf59d37cd (patch)
treed09466217844d04a8289a2d2d15377ce38987426 /t/lib/open2.t
parente6d5c5302bca4863c13ae11aa5ed04b35c9d89f5 (diff)
downloadperl-f55ee38a033ce570145fdd38bb9f09acf59d37cd.tar.gz
various win32 odds and ends
- added support for waitpid(), open2/open3, and a bugfix for kill() from Ronald Schmidt <RonaldWS@aol.com> - tweak testsuite mods of above - regenerate win32/config_H.?c - change kill() to win32_kill() and export it - coalesce common code in win32.c - add PerlProc_waitpid() and export win32_waitpid() result builds and passes on the three win32 compilers p4raw-id: //depot/perl@1134
Diffstat (limited to 't/lib/open2.t')
-rwxr-xr-xt/lib/open2.t21
1 files changed, 17 insertions, 4 deletions
diff --git a/t/lib/open2.t b/t/lib/open2.t
index a2e6a07a7b..85b807c98a 100755
--- a/t/lib/open2.t
+++ b/t/lib/open2.t
@@ -4,7 +4,10 @@ BEGIN {
chdir 't' if -d 't';
@INC = '../lib';
require Config; import Config;
- unless ($Config{'d_fork'}) {
+ if (!$Config{'d_fork'}
+ # open2/3 supported on win32 (but not Borland due to CRT bugs)
+ && ($^O ne 'MSWin32' || $Config{'cc'} =~ /^bcc/i))
+ {
print "1..0\n";
exit 0;
}
@@ -25,20 +28,30 @@ sub ok {
print "ok $n\n";
}
else {
- print "not ok $n\n";
+ print "not ok $n\n";
print "# $info\n" if $info;
}
}
+sub cmd_line {
+ if ($^O eq 'MSWin32') {
+ return qq/"$_[0]"/;
+ }
+ else {
+ return $_[0];
+ }
+}
+
my ($pid, $reaped_pid);
STDOUT->autoflush;
STDERR->autoflush;
print "1..7\n";
-ok 1, $pid = open2 'READ', 'WRITE', $perl, '-e', 'print scalar <STDIN>';
+ok 1, $pid = open2 'READ', 'WRITE', $perl, '-e',
+ cmd_line('print scalar <STDIN>');
ok 2, print WRITE "hi kid\n";
-ok 3, <READ> eq "hi kid\n";
+ok 3, <READ> =~ /^hi kid\r?\n$/;
ok 4, close(WRITE), $!;
ok 5, close(READ), $!;
$reaped_pid = waitpid $pid, 0;