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);
my @testitems = @Support::Files::testitems;
-foreach my $file (@testitems) {
+sub test_file {
+ my ($file) = @_;
+
my $clean = 1;
my $source;
{
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;