# three ways to spawn our own short-lived Perl scripts for testing:
#
# 0 - (fork|vfork) + execve, the most realistic but slowest
# three ways to spawn our own short-lived Perl scripts for testing:
#
# 0 - (fork|vfork) + execve, the most realistic but slowest
# 2 - preloading and running in current process (slightly faster than 1)
#
# 2 is not compatible with scripts which use "exit" (which we'll try to
# 2 - preloading and running in current process (slightly faster than 1)
#
# 2 is not compatible with scripts which use "exit" (which we'll try to
sub start_script {
my ($cmd, $env, $opt) = @_;
my ($key, @argv) = @$cmd;
sub start_script {
my ($cmd, $env, $opt) = @_;
my ($key, @argv) = @$cmd;
my $ret = waitpid($pid, 0);
defined($ret) or die "waitpid($pid): $!";
$ret == $pid or die "waitpid($pid) != $ret";
my $ret = waitpid($pid, 0);
defined($ret) or die "waitpid($pid): $!";
$ret == $pid or die "waitpid($pid) != $ret";
PublicInbox::TestCommon::wait_for_tail();
CORE::kill('TERM', $tail);
}
PublicInbox::TestCommon::wait_for_tail();
CORE::kill('TERM', $tail);
}