X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=t%2Fstructure%2Fcommon_errors.t;h=ab0ff3b27992ea7b85156011c43239b3b30e58fc;hb=94a76a6dec718925c0d18655cfb35d1cde27afd5;hp=6e73070b19965ed70a9c2799ade93bc9324f4878;hpb=31a9cb9dbe9eb562576f69b77676e880781ed332;p=kivitendo-erp.git diff --git a/t/structure/common_errors.t b/t/structure/common_errors.t old mode 100644 new mode 100755 index 6e73070b1..ab0ff3b27 --- a/t/structure/common_errors.t +++ b/t/structure/common_errors.t @@ -1,8 +1,11 @@ #!/usr/bin/perl use strict; +use threads; use lib 't'; use Support::Files; +use Sys::CPU; +use Thread::Pool::Simple; my ($testcount); @@ -32,15 +35,16 @@ my @testitems = @Support::Files::testitems; my @common_errors = ([ '^\s*my\s+%[a-z0-9_]+\s*=\s*shift' ], [ '^\s*my\s+\(.*\)\s*=\s*shift' ], - [ '^\s*my\s+\$.*\s*=\s*@_' ], + [ '^\s*my\s+\$[^=]*=\s*@_' ], [ '@[a-z0-9_]+->' ], [ 'uft8' ], [ '\$slef' ], ); -foreach my $file (@testitems) { +sub test_file { + my ($file) = @_; $file =~ s/\s.*$//; # nuke everything after the first space (#comment) - next if (!$file); # skip null entries + return if (!$file); # skip null entries if (open (FILE, $file)) { # open the file for reading $_->[1] = [] foreach @common_errors; @@ -67,5 +71,15 @@ foreach my $file (@testitems) { } } -exit 0; +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; + +exit 0;