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