Bugzilla – Attachment 171052 Details for
Bug 37245
Add test script that runs `perl -c` on all Perl files
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37245: Modify 00-strict.t to check all Perl files
Bug-37245-Modify-00-strictt-to-check-all-Perl-file.patch (text/plain), 2.90 KB, created by
Julian Maurice
on 2024-09-05 10:27:02 UTC
(
hide
)
Description:
Bug 37245: Modify 00-strict.t to check all Perl files
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2024-09-05 10:27:02 UTC
Size:
2.90 KB
patch
obsolete
>From 133802332bbc4a7ea53fe8b905e96a9189925297 Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Wed, 3 Jul 2024 15:14:27 +0200 >Subject: [PATCH] Bug 37245: Modify 00-strict.t to check all Perl files > >and minor changes to Koha::Localization and Koha::MarcOverlayRules to >make tests pass > >Test plan: >- Run `prove t/db_dependent/00-strict.t` >- Wait... (it took ~5 minutes for me) >- Should be green at the end > >Signed-off-by: David Nind <david@davidnind.com> >--- > Koha/Localization.pm | 1 + > Koha/MarcOverlayRules.pm | 3 ++- > t/db_dependent/00-strict.t | 34 +++++++--------------------------- > 3 files changed, 10 insertions(+), 28 deletions(-) > >diff --git a/Koha/Localization.pm b/Koha/Localization.pm >index 90201b8870..7e91d76a11 100644 >--- a/Koha/Localization.pm >+++ b/Koha/Localization.pm >@@ -18,6 +18,7 @@ package Koha::Localization; > use Modern::Perl; > > use Koha::Database; >+use Koha::Caches; > > use base qw(Koha::Object); > >diff --git a/Koha/MarcOverlayRules.pm b/Koha/MarcOverlayRules.pm >index b874f7cd07..99af52f1de 100644 >--- a/Koha/MarcOverlayRules.pm >+++ b/Koha/MarcOverlayRules.pm >@@ -17,9 +17,10 @@ package Koha::MarcOverlayRules; > > use Modern::Perl; > use List::Util qw(first); >-use Koha::MarcOverlayRule; > use Carp; > >+use Koha::Caches; >+use Koha::MarcOverlayRule; > use Koha::Exceptions::MarcOverlayRule; > use Try::Tiny; > use Scalar::Util qw(looks_like_number); >diff --git a/t/db_dependent/00-strict.t b/t/db_dependent/00-strict.t >index 41515a9451..f7030b4335 100755 >--- a/t/db_dependent/00-strict.t >+++ b/t/db_dependent/00-strict.t >@@ -11,29 +11,11 @@ use Parallel::ForkManager; > use Sys::CPU; > > use lib("misc/translator"); >-use lib("installer"); >- >-my @dirs = ( >- 'acqui', 'admin', >- 'authorities', 'basket', >- 'catalogue', 'cataloguing', >- 'changelanguage.pl', 'circ', >- 'debian', 'docs', >- 'errors', 'fix-perl-path.PL', 'help.pl', >- 'installer', 'kohaversion.pl', 'labels', >- 'mainpage.pl', 'Makefile.PL', >- 'members', 'misc', >- 'offline_circ', 'opac', >- 'patroncards', 'reports', >- 'reserve', 'reviews', >- 'rewrite-config.PL', 'rotating_collections', >- 'serials', 'services', >- 'skel', 'suggestion', >- 'svc', 'tags', >- 'tools', 'virtualshelves' >-); >- >-$Test::Strict::TEST_STRICT = 0; >+ >+my @files = `git ls-files '*.pl' '*.PL' '*.pm' '*.psgi'`; >+chomp(@files); >+ >+plan tests => scalar @files; > > my $ncpu; > if ( $ENV{KOHA_PROVE_CPUS} ) { >@@ -44,14 +26,12 @@ if ( $ENV{KOHA_PROVE_CPUS} ) { > > my $pm = Parallel::ForkManager->new($ncpu); > >-foreach my $d (@dirs) { >+foreach my $file (@files) { > $pm->start and next; # do the fork > >- all_perl_files_ok($d); >+ syntax_ok($file); > > $pm->finish; # do the exit in the child process > } > > $pm->wait_all_children; >- >-done_testing(); >-- >2.39.2
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 37245
:
168449
|
168477
| 171052