Bugzilla – Attachment 184175 Details for
Bug 40419
xt/find-license-problems.t isn't catching all instances of 51 Franklin St/Street
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40419: Changes to testing logic
Bug-40419-Changes-to-testing-logic.patch (text/plain), 2.84 KB, created by
Tomás Cohen Arazi (tcohen)
on 2025-07-16 20:29:23 UTC
(
hide
)
Description:
Bug 40419: Changes to testing logic
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2025-07-16 20:29:23 UTC
Size:
2.84 KB
patch
obsolete
>From 07aad0475c25fe433d909c66931a93bd31285637 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Wed, 16 Jul 2025 14:56:43 -0300 >Subject: [PATCH] Bug 40419: Changes to testing logic > >This patch makes a couple changes to the tests: > >* Remove check for Copyright line. The Copyright line should not be mandatory. >* Remove dependency of GPL-related checks on the copyrigth line > existence. (this highlights several missed checks). >* Skip testing-related templates. Koha ships some templates that are not > excluded correctly. > >This 'fix' will highlight existing errors that were skipped until now. > >To test: >1. Run: > $ ktd --shell > k$ prove xt/find-license-problems.t >=> FAIL: Tests pass! Some files should make them fail! >2. Apply this patch >3. Repeat 1 >=> SUCCESS: Tests fail! >--- > xt/find-license-problems.t | 14 +++++++------- > 1 file changed, 7 insertions(+), 7 deletions(-) > >diff --git a/xt/find-license-problems.t b/xt/find-license-problems.t >index 92edba9353e..3c576b7a515 100755 >--- a/xt/find-license-problems.t >+++ b/xt/find-license-problems.t >@@ -33,6 +33,7 @@ my @files = map { > !( $name =~ m{^koha-tmpl/} > || $name =~ m{\.(gif|jpg|odt|ogg|pdf|png|po|psd|svg|swf|zip)$} > || $name =~ m{xt/find-license-problems|xt/fix-old-fsf-address|misc/translator/po2json} >+ || $name =~ m[t/mock_templates/intranet-tmpl/prog] > || !-f $name ) > ? $_ > : () >@@ -43,14 +44,13 @@ plan tests => scalar(@files) + 1; > foreach my $name (@files) { > open( my $fh, '<', $name ) || die "cannot open file $name $!"; > my ( >- $hascopyright, $hasgpl, $hasv3, $hasorlater, $haslinktolicense, >+ $hasgpl, $hasv3, $hasorlater, $haslinktolicense, > $hasfranklinst, $is_not_us > ) = (0) x 7; > while ( my $line = <$fh> ) { >- $hascopyright = 1 if ( $line =~ /^(#|--)?\s*Copyright.*\d\d/ ); >- $hasgpl = 1 if ( $line =~ /GNU General Public License/ ); >- $hasv3 = 1 if ( $line =~ /either version 3/ ); >- $hasorlater = 1 >+ $hasgpl = 1 if ( $line =~ /GNU General Public License/ ); >+ $hasv3 = 1 if ( $line =~ /either version 3/ ); >+ $hasorlater = 1 > if ( $line =~ /any later version/ > || $line =~ /at your option/ ); > $haslinktolicense = 1 if $line =~ m|http://www\.gnu\.org/licenses|; >@@ -59,12 +59,12 @@ foreach my $name (@files) { > } > close $fh; > >- if ( !$hascopyright || $is_not_us ) { >+ if ( $is_not_us || !$hasgpl ) { > pass(); > next; > } > >- is( $hasgpl && $hasv3 && $hasorlater && $haslinktolicense && !$hasfranklinst, 1 ) >+ ok( $hasgpl && $hasv3 && $hasorlater && $haslinktolicense && !$hasfranklinst ) > or diag( > sprintf > "File %s has wrong copyright: hasgpl=%s, hasv3=%s, hasorlater=%s, haslinktolicense=%s, hasfranklinst=%s", >-- >2.50.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 40419
:
184164
|
184165
|
184166
|
184175
|
184176
|
184182
|
184183