App-pandoc-preprocess

 view release on metacpan or  search on metacpan

t/10-dirs.t  view on Meta::CPAN


eval "use IPC::Shareable";
Test::More->builder->BAIL_OUT("test requires IPC::Shareable") if $@;

# global variables across processes
my ($stdout, $stderr);
tie $stdout, 'IPC::Shareable', 'stdout', { create => 'true' } or die "tie failed\n";;
tie $stderr, 'IPC::Shareable', 'stderr', { create => 'true' } or die "tie failed\n";;

# emulate calling ppp on command line
sub ppp(@) {
    $stdout = undef;
    $stderr = undef;

    my $pid = fork();
    if ($pid == 0) {
        local @ARGV = @_;
        my ($stdout, $stderr);
        tie $stdout, 'IPC::Shareable', 'stdout';
        tie $stderr, 'IPC::Shareable', 'stderr';
        ($stdout, $stderr) = Capture::Tiny::capture(sub { do 'bin/ppp'; });



( run in 0.514 second using v1.01-cache-2.11-cpan-65fba6d93b7 )