|
Server : Apache/2.2.22 (Unix) mod_ssl/2.2.22 OpenSSL/1.0.0-fips mod_auth_passthrough/2.1 mod_bwlimited/1.4 System : Linux server.jackjohnson.com 2.6.32-279.5.2.el6.x86_64 #1 SMP Fri Aug 24 01:07:11 UTC 2012 x86_64 User : jackjohn ( 502) PHP Version : 5.3.17 Disable Function : NONE Directory : /installd/perl588installer/perl-5.8.8/t/lib/ |
Upload File : |
#!perl
BEGIN {
chdir 't' if -d 't';
@INC = ('../lib');
unless ($^O eq "cygwin") {
print "1..0 # skipped: cygwin specific test\n";
exit 0;
}
}
use Test::More tests => 4;
is(Cygwin::winpid_to_pid(Cygwin::pid_to_winpid($$)), $$,
"perl pid translates to itself");
my $parent = getppid;
SKIP: {
skip "test not run from cygwin process", 1 if $parent <= 1;
is(Cygwin::winpid_to_pid(Cygwin::pid_to_winpid($parent)), $parent,
"parent pid translates to itself");
}
my $catpid = open my $cat, "|cat" or die "Couldn't cat: $!";
open my $ps, "ps|" or die "Couldn't do ps: $!";
my ($catwinpid) = map /^.\s+$catpid\s+\d+\s+\d+\s+(\d+)/, <$ps>;
close($ps);
is(Cygwin::winpid_to_pid($catwinpid), $catpid, "winpid to pid");
is(Cygwin::pid_to_winpid($catpid), $catwinpid, "pid to winpid");
close($cat);