openpid.t revision 7c478bd95313f5f23a4c958a745db2134aa03244
#!./perl
#####################################################################
#
# Test for process id return value from open
# Ronald Schmidt (The Software Path) RonaldWS@software-path.com
#
#####################################################################
BEGIN {
chdir 't' if -d 't';
print "1..0 # Skip: no multitasking\n";
exit 0;
}
}
use Config;
$| = 1;
print "1..10\n";
#
# commands run 4 perl programs. Two of these programs write a
# short message to STDOUT and exit. Two of these programs
# read from STDIN. One reader never exits and must be killed.
# the other reader reads one line, waits a few seconds and then
# exits to test the waitpid function.
#
#warn "#$cmd1\n#$cmd2\n#$cmd3\n#$cmd4\n";
# start the processes
print "ok 1\n";
print "ok 2\n";
print "ok 3\n";
print "ok 4\n";
my $killsig = 'HUP';
# get message from first process and kill it
print "# child1 returned [$from_pid1]\nnot "
print "ok 5\n";
print "ok 6\n";
# get message from second process and kill second process and reader process
print "# child2 returned [$from_pid2]\nnot "
print "ok 7\n";
print "ok 8\n";
# send one expected line of text to child process and then wait for it
print FH4 "ok 9\n";
print "# waiting for process $pid4 to exit\n";
print "ok 10\n";