Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 3ee997c2

Von Moritz Bunkus vor etwa 8 Jahren hinzugefügt

  • ID 3ee997c2e21f1e1488e518e58d3d5c9a369433d1
  • Vorgänger 2dd5bd53
  • Nachfolger 83c97773

Tests: t/structure/common_errors.t parallelisiert

Unterschiede anzeigen:

t/structure/common_errors.t
#!/usr/bin/perl
use strict;
use threads;
use lib 't';
use Support::Files;
use Sys::CPU;
use Thread::Pool::Simple;
my ($testcount);
......
[ '\$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;
......
}
}
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;

Auch abrufbar als: Unified diff