Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 388e410d

Von Moritz Bunkus vor fast 8 Jahren hinzugefügt

  • ID 388e410dd6c9b800e1d857e5cb1643b2acd73ca5
  • Vorgänger d9e8ef2c
  • Nachfolger 2dd5bd53

Tests: t/structure/no_indirect_object_notation.t parallelisiert

Unterschiede anzeigen:

t/structure/no_indirect_object_notation.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);
......
11 14

  
12 15
my @testitems = @Support::Files::testitems;
13 16

  
14
foreach my $file (@testitems) {
17
sub test_file {
18
  my ($file) = @_;
19

  
15 20
  my $clean = 1;
16 21
  my $source;
17 22
  {
......
56 61

  
57 62
  ok $clean, $file;
58 63
}
64

  
65
my $pool = Thread::Pool::Simple->new(
66
  min    => 2,
67
  max    => Sys::CPU::cpu_count() + 1,
68
  do     => [ \&test_file ],
69
  passid => 0,
70
);
71

  
72
$pool->add($_) for @testitems;
73

  
74
$pool->join;

Auch abrufbar als: Unified diff