Revision 2dd5bd53
Von Moritz Bunkus vor fast 8 Jahren hinzugefügt
t/structure/no_lexicals_in_postif.t | ||
---|---|---|
1 | 1 |
use strict; |
2 |
use threads; |
|
2 | 3 |
use lib 't'; |
3 | 4 |
use Support::Files; |
5 |
use Sys::CPU; |
|
4 | 6 |
use Test::More; |
7 |
use Thread::Pool::Simple; |
|
5 | 8 |
|
6 | 9 |
if (eval { require PPI; 1 }) { |
7 | 10 |
plan tests => scalar(@Support::Files::testitems); |
... | ... | |
23 | 26 |
|
24 | 27 |
my @testitems = @Support::Files::testitems; |
25 | 28 |
|
26 |
foreach my $file (@testitems) { |
|
29 |
sub test_file { |
|
30 |
my ($file) = @_; |
|
27 | 31 |
my $clean = 1; |
28 | 32 |
my $source; |
29 | 33 |
{ |
... | ... | |
63 | 67 |
|
64 | 68 |
ok $clean, $file; |
65 | 69 |
} |
70 |
|
|
71 |
my $pool = Thread::Pool::Simple->new( |
|
72 |
min => 2, |
|
73 |
max => Sys::CPU::cpu_count() + 1, |
|
74 |
do => [ \&test_file ], |
|
75 |
passid => 0, |
|
76 |
); |
|
77 |
|
|
78 |
$pool->add($_) for @testitems; |
|
79 |
|
|
80 |
$pool->join; |
Auch abrufbar als: Unified diff
Tests: t/structure/no_lexicals_in_postif.t parallelisiert