Lines 19-24
use Modern::Perl;
Link Here
|
19 |
use threads; # used for parallel |
19 |
use threads; # used for parallel |
20 |
use File::Slurp qw( read_file ); |
20 |
use File::Slurp qw( read_file ); |
21 |
use Test::More; |
21 |
use Test::More; |
|
|
22 |
use Test::NoWarnings; |
22 |
use Test::Strict; |
23 |
use Test::Strict; |
23 |
use Parallel::ForkManager; |
24 |
use Parallel::ForkManager; |
24 |
use Sys::CPU; |
25 |
use Sys::CPU; |
Lines 39-54
if ( $ENV{KOHA_PROVE_CPUS} ) {
Link Here
|
39 |
|
40 |
|
40 |
my $pm = Parallel::ForkManager->new($ncpu); |
41 |
my $pm = Parallel::ForkManager->new($ncpu); |
41 |
|
42 |
|
|
|
43 |
plan tests => scalar(@tt_files) + 1; |
44 |
|
42 |
foreach my $filepath (@tt_files) { |
45 |
foreach my $filepath (@tt_files) { |
43 |
$pm->start and next; |
46 |
$pm->start and next; |
44 |
|
47 |
|
45 |
my $tidy = qx{perl misc/devel/tidy.pl --silent --no-write $filepath}; |
48 |
if ( !-s $filepath ) { |
46 |
my $content = read_file $filepath; |
49 |
|
47 |
ok( $content eq $tidy, "$filepath should be kept tidy" ); |
50 |
# Do not tidy empty files |
|
|
51 |
ok(1); |
52 |
} else { |
53 |
my $tidy = qx{perl misc/devel/tidy.pl --silent --no-write $filepath}; |
54 |
my $content = read_file $filepath; |
55 |
ok( $content eq $tidy, "$filepath should be kept tidy" ); |
56 |
} |
48 |
|
57 |
|
49 |
$pm->finish; |
58 |
$pm->finish; |
50 |
} |
59 |
} |
51 |
|
60 |
|
52 |
$pm->wait_all_children; |
61 |
$pm->wait_all_children; |
53 |
|
|
|
54 |
done_testing; |