X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=t%2Fstructure%2Fno_lexicals_in_postif.t;h=b9f9c4cdfe42874a69eaab533b5d45d685b57996;hb=1268bf670c06f5a66ad78a75e41ad6c15061d9bc;hp=3f906937fd57337d1bc5a2067bb88cc73cd98347;hpb=74fca575d438232002756175338c23f55b8a6c12;p=kivitendo-erp.git diff --git a/t/structure/no_lexicals_in_postif.t b/t/structure/no_lexicals_in_postif.t index 3f906937f..b9f9c4cdf 100644 --- a/t/structure/no_lexicals_in_postif.t +++ b/t/structure/no_lexicals_in_postif.t @@ -1,7 +1,10 @@ use strict; +use threads; use lib 't'; use Support::Files; +use Sys::CPU; use Test::More; +use Thread::Pool::Simple; if (eval { require PPI; 1 }) { plan tests => scalar(@Support::Files::testitems); @@ -23,7 +26,8 @@ my $fh; my @testitems = @Support::Files::testitems; -foreach my $file (@testitems) { +sub test_file { + my ($file) = @_; my $clean = 1; my $source; { @@ -63,3 +67,14 @@ foreach my $file (@testitems) { ok $clean, $file; } + +my $pool = Thread::Pool::Simple->new( + min => 2, + max => Sys::CPU::cpu_count() + 1, + do => [ \&test_file ], + passid => 0, +); + +$pool->add($_) for @testitems; + +$pool->join;