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

(-)a/xt/find-missing-filters.t (-27 / +10 lines)
Lines 17-56 Link Here
17
17
18
use Modern::Perl;
18
use Modern::Perl;
19
use Test::More tests => 1;
19
use Test::More tests => 1;
20
use File::Find;
20
use File::Spec;
21
use File::Slurp;
21
use File::Slurp qw( read_file );
22
use Data::Dumper;
22
use Data::Dumper;
23
use t::lib::QA::TemplateFilters;
23
use t::lib::QA::TemplateFilters;
24
24
25
my @themes;
26
27
# OPAC themes
28
my $opac_dir  = 'koha-tmpl/opac-tmpl';
29
opendir ( my $dh, $opac_dir ) or die "can't opendir $opac_dir: $!";
30
for my $theme ( grep { not /^\.|lib|js|xslt/ } readdir($dh) ) {
31
    push @themes, "$opac_dir/$theme/en";
32
}
33
close $dh;
34
35
# STAFF themes
36
my $staff_dir = 'koha-tmpl/intranet-tmpl';
37
opendir ( $dh, $staff_dir ) or die "can't opendir $staff_dir: $!";
38
for my $theme ( grep { not /^\.|lib|js/ } readdir($dh) ) {
39
    push @themes, "$staff_dir/$theme/en";
40
}
41
close $dh;
42
43
my @files;
25
my @files;
44
sub wanted {
45
    my $name = $File::Find::name;
46
    push @files, $name
47
        if $name =~ m[\.(tt|inc)$] and -f $name;
48
}
49
26
50
find({ wanted => \&wanted, no_chdir => 1 }, @themes );
27
# OPAC
28
push @files, `git ls-files 'koha-tmpl/opac-tmpl/bootstrap/en/*.tt'`;
29
push @files, `git ls-files 'koha-tmpl/opac-tmpl/bootstrap/en/*.inc'`;
30
31
# Staff
32
push @files, `git ls-files 'koha-tmpl/intranet-tmpl/prog/en/*.tt'`;
33
push @files, `git ls-files 'koha-tmpl/intranet-tmpl/prog/en/*.inc'`;
51
34
52
my @errors;
35
my @errors;
53
for my $file ( @files ) {
36
for my $file ( @files ) {
37
    chomp $file;
54
    my $content = read_file($file);
38
    my $content = read_file($file);
55
    my @e = t::lib::QA::TemplateFilters::missing_filters($content);
39
    my @e = t::lib::QA::TemplateFilters::missing_filters($content);
56
    push @errors, { file => $file, errors => \@e } if @e;
40
    push @errors, { file => $file, errors => \@e } if @e;
57
- 

Return to bug 33743