Lines 25-46
Link Here
|
25 |
|
25 |
|
26 |
use Modern::Perl; |
26 |
use Modern::Perl; |
27 |
use Test::More; |
27 |
use Test::More; |
|
|
28 |
use Test::NoWarnings; |
28 |
|
29 |
|
29 |
use File::Spec; |
30 |
my @files = map { |
30 |
use File::Find; |
31 |
chomp; |
|
|
32 |
my $name = $_; |
33 |
!( $name =~ m{^koha-tmpl/} |
34 |
|| $name =~ m{\.(gif|jpg|odt|ogg|pdf|png|po|psd|svg|swf|zip)$} |
35 |
|| $name =~ m{xt/find-license-problems|xt/fix-old-fsf-address|misc/translator/po2json} |
36 |
|| !-f $name ) |
37 |
? $_ |
38 |
: () |
39 |
} `git ls-tree -r HEAD --name-only`; # only files part of git |
31 |
|
40 |
|
32 |
my @files; |
41 |
plan tests => scalar(@files) + 1; |
33 |
|
|
|
34 |
sub wanted { |
35 |
my $name = $File::Find::name; |
36 |
push @files, $name |
37 |
unless $name =~ /\/(\.git|koha-tmpl|node_modules|swagger-ui)(\/.*)?$/ |
38 |
|| $name =~ /\.(gif|jpg|odt|ogg|pdf|png|po|psd|svg|swf|zip|patch)$/ |
39 |
|| $name =~ m[(xt/find-license-problems|xt/fix-old-fsf-address|misc/translator/po2json)] |
40 |
|| !-f $name; |
41 |
} |
42 |
|
43 |
find( { wanted => \&wanted, no_chdir => 1 }, File::Spec->curdir() ); |
44 |
|
42 |
|
45 |
foreach my $name (@files) { |
43 |
foreach my $name (@files) { |
46 |
open( my $fh, '<', $name ) || die "cannot open file $name $!"; |
44 |
open( my $fh, '<', $name ) || die "cannot open file $name $!"; |
Lines 60-67
foreach my $name (@files) {
Link Here
|
60 |
$is_not_us = 1 if $line =~ m|This file is part of the Zebra server|; |
58 |
$is_not_us = 1 if $line =~ m|This file is part of the Zebra server|; |
61 |
} |
59 |
} |
62 |
close $fh; |
60 |
close $fh; |
63 |
next unless $hascopyright; |
61 |
|
64 |
next if $is_not_us; |
62 |
if ( !$hascopyright || $is_not_us ) { |
|
|
63 |
pass(); |
64 |
next; |
65 |
} |
66 |
|
65 |
is( $hasgpl && $hasv3 && $hasorlater && $haslinktolicense && !$hasfranklinst, 1 ) |
67 |
is( $hasgpl && $hasv3 && $hasorlater && $haslinktolicense && !$hasfranklinst, 1 ) |
66 |
or diag( |
68 |
or diag( |
67 |
sprintf |
69 |
sprintf |
Lines 69-72
foreach my $name (@files) {
Link Here
|
69 |
$name, $hasgpl, $hasv3, $hasorlater, $haslinktolicense, $hasfranklinst |
71 |
$name, $hasgpl, $hasv3, $hasorlater, $haslinktolicense, $hasfranklinst |
70 |
); |
72 |
); |
71 |
} |
73 |
} |
72 |
done_testing; |
|
|
73 |
- |