Lines 20-25
Link Here
|
20 |
use strict; |
20 |
use strict; |
21 |
use warnings; |
21 |
use warnings; |
22 |
|
22 |
|
|
|
23 |
use threads; # used for parallel |
24 |
use Parallel::ForkManager; |
25 |
use Sys::CPU; |
26 |
|
23 |
=head1 NAME |
27 |
=head1 NAME |
24 |
|
28 |
|
25 |
valid-templates.t |
29 |
valid-templates.t |
Lines 64-71
for my $theme ( grep { not /^\.|lib|js/ } readdir($dh) ) {
Link Here
|
64 |
} |
68 |
} |
65 |
close $dh; |
69 |
close $dh; |
66 |
|
70 |
|
|
|
71 |
my $ncpu; |
72 |
if ( $ENV{KOHA_PROVE_CPUS} ) { |
73 |
$ncpu = $ENV{KOHA_PROVE_CPUS} ; # set number of cpus to use |
74 |
} else { |
75 |
$ncpu = Sys::CPU::cpu_count(); |
76 |
} |
77 |
|
78 |
my $pm = new Parallel::ForkManager($ncpu); |
79 |
|
67 |
# Tests |
80 |
# Tests |
68 |
foreach my $theme ( @themes ) { |
81 |
foreach my $theme ( @themes ) { |
|
|
82 |
$pm->start and next; # do the fork |
69 |
print "Testing $theme->{'type'} $theme->{'theme'} templates\n"; |
83 |
print "Testing $theme->{'type'} $theme->{'theme'} templates\n"; |
70 |
if ( $theme->{'theme'} eq 'bootstrap' ) { |
84 |
if ( $theme->{'theme'} eq 'bootstrap' ) { |
71 |
run_template_test( |
85 |
run_template_test( |
Lines 83-90
foreach my $theme ( @themes ) {
Link Here
|
83 |
$theme->{'includes'}, |
97 |
$theme->{'includes'}, |
84 |
); |
98 |
); |
85 |
} |
99 |
} |
|
|
100 |
$pm->finish; |
86 |
} |
101 |
} |
87 |
|
102 |
|
|
|
103 |
$pm->wait_all_children; |
104 |
|
88 |
done_testing(); |
105 |
done_testing(); |
89 |
|
106 |
|
90 |
sub run_template_test { |
107 |
sub run_template_test { |
91 |
- |
|
|