Skip to content

Instantly share code, notes, and snippets.

@autarch
Created February 21, 2016 19:26
Show Gist options
  • Select an option

  • Save autarch/61e3a84ac83c36080280 to your computer and use it in GitHub Desktop.

Select an option

Save autarch/61e3a84ac83c36080280 to your computer and use it in GitHub Desktop.
use strict;
use warnings;
use Test2::IPC;
use Parallel::ForkManager;
use Test2::API qw( context run_subtest test2_stack );
use Test::More;
my $pfm = Parallel::ForkManager->new(2);
for my $class (qw( Foo Bar )) {
run_subtest(
$class,
sub {
_run_class($class);
}
);
}
$pfm->wait_all_children;
test2_stack()->top->cull;
done_testing();
sub _run_class {
my $class = shift;
for my $instance (qw( i1 i2 )) {
next if $pfm->start;
run_subtest(
"$class - $instance",
sub { ok( 1, "$class - $instance ok" ) }
);
$pfm->finish(0);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment