xref: /openbsd-src/gnu/usr.bin/perl/t/op/kill0_child (revision 6fb12b7054efc6b436584db6cef9c2f85c0d7e27)
1*6fb12b70Safresh1# kill0_child: an auxiliary script called from t/op/kill0.t
2*6fb12b70Safresh1#
3*6fb12b70Safresh1# $ARGV[0] is the filename that is used to notify the parent .t perl
4*6fb12b70Safresh1# process that all PIDs are started in the process tree.
5*6fb12b70Safresh1# The numbers 9999s and 9998 are intended to be eye catching; they will
6*6fb12b70Safresh1# only appear if we're not killed in time.
7*6fb12b70Safresh1
8*6fb12b70Safresh1system(1, $^X, '-e', 'sleep 5; print qq|not ok 9999 - inner child process wasn\'t killed\n|;');
9*6fb12b70Safresh1system('echo outer child started > "'.$ARGV[0].'"');
10*6fb12b70Safresh1sleep 5;
11*6fb12b70Safresh1
12*6fb12b70Safresh1# execution won't reach here if the test is successful
13*6fb12b70Safresh1print "not ok 9998 - outer child process wasn\'t killed\n";
14*6fb12b70Safresh1unlink($ARGV[0]);
15