View | Details | Raw Unified | Return to bug 38664
Collapse All | Expand All

(-)a/misc/devel/tidy.pl (-2 / +1 lines)
Lines 50-56 my @exceptions = qw( Link Here
50
    misc/cronjobs/rss/lastAcquired-2.0.tt
50
    misc/cronjobs/rss/lastAcquired-2.0.tt
51
    misc/cronjobs/rss/longestUnseen.tt
51
    misc/cronjobs/rss/longestUnseen.tt
52
    misc/cronjobs/rss/mostReserved.tt
52
    misc/cronjobs/rss/mostReserved.tt
53
    t/db_dependent/misc/translator/sample.tt
54
);
53
);
55
54
56
@files = array_minus( @files, @exceptions );
55
@files = array_minus( @files, @exceptions );
Lines 121-127 sub get_js_files { Link Here
121
}
120
}
122
121
123
sub get_tt_files {
122
sub get_tt_files {
124
    my @files = qx{git ls-files '*.tt' '*.inc' ':(exclude)Koha/ILL/Backend/' ':(exclude)doc-head-open.inc'};
123
    my @files = qx{git ls-files '*.tt' '*.inc' ':(exclude)Koha/ILL/Backend/' ':(exclude)*doc-head-open.inc'};
125
    chomp for @files;
124
    chomp for @files;
126
    return @files;
125
    return @files;
127
}
126
}
(-)a/xt/tt_tidy.t (-1 / +53 lines)
Line 0 Link Here
0
- 
1
#/usr/bin/perl
2
3
# This file is part of Koha.
4
#
5
# Koha is free software; you can redistribute it and/or modify it
6
# under the terms of the GNU General Public License as published by
7
# the Free Software Foundation; either version 3 of the License, or
8
# (at your option) any later version.
9
#
10
# Koha is distributed in the hope that it will be useful, but
11
# WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
# GNU General Public License for more details.
14
#
15
# You should have received a copy of the GNU General Public License
16
# along with Koha; if not, see <http://www.gnu.org/licenses>.
17
18
use Modern::Perl;
19
use threads;    # used for parallel
20
use File::Slurp qw( read_file );
21
use Test::More;
22
use Test::Strict;
23
use Parallel::ForkManager;
24
use Sys::CPU;
25
26
my @tt_files =
27
    qx{git ls-files '*.tt' '*.inc' ':(exclude)Koha/ILL/Backend/' ':(exclude)*doc-head-open.inc' ':(exclude)misc/cronjobs/rss'};
28
29
$Test::Strict::TEST_STRICT = 0;
30
31
my $ncpu;
32
if ( $ENV{KOHA_PROVE_CPUS} ) {
33
    $ncpu = $ENV{KOHA_PROVE_CPUS};
34
} else {
35
    $ncpu = Sys::CPU::cpu_count();
36
}
37
38
my $pm = Parallel::ForkManager->new($ncpu);
39
40
foreach my $filepath (@tt_files) {
41
    $pm->start and next;
42
43
    chomp $filepath;
44
    my $tidy    = qx{perl misc/devel/tidy.pl --silent --no-write $filepath};
45
    my $content = read_file $filepath;
46
    ok( $content eq $tidy, "$filepath should be kept tidy" );
47
48
    $pm->finish;
49
}
50
51
$pm->wait_all_children;
52
53
done_testing;

Return to bug 38664