X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=t%2Fstructure%2Fno_indirect_object_notation.t;fp=t%2Fstructure%2Fno_indirect_object_notation.t;h=d3e5fe06dbe273e9edd927adeedd15df7246b5b5;hb=53593baa211863fbf66540cf1bcc36c8fb37257f;hp=f0a54d9f68b215c425dd6574318b7e4319b417fc;hpb=deb4d2dbb676d7d6f69dfe7815d6e0cb09bd4a44;p=kivitendo-erp.git diff --git a/t/structure/no_indirect_object_notation.t b/t/structure/no_indirect_object_notation.t index f0a54d9f6..d3e5fe06d 100644 --- a/t/structure/no_indirect_object_notation.t +++ b/t/structure/no_indirect_object_notation.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); @@ -11,7 +14,9 @@ if (eval { require PPI; 1 }) { my @testitems = @Support::Files::testitems; -foreach my $file (@testitems) { +sub test_file { + my ($file) = @_; + my $clean = 1; my $source; { @@ -56,3 +61,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;