Created
February 21, 2016 19:26
-
-
Save autarch/f0d35404a6dc41178d97 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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