Bugzilla – Attachment 153525 Details for
Bug 33745
Speed up Koha::Object attribute accessors
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33745: (follow-up) Add exception to 00-testcritic.t
Bug-33745-follow-up-Add-exception-to-00-testcritic.patch (text/plain), 2.05 KB, created by
Marcel de Rooy
on 2023-07-17 07:24:56 UTC
(
hide
)
Description:
Bug 33745: (follow-up) Add exception to 00-testcritic.t
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2023-07-17 07:24:56 UTC
Size:
2.05 KB
patch
obsolete
>From 4c1e5a6a58ab8639354128e4c3aee0d6c9deea6f Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Mon, 17 Jul 2023 07:13:38 +0000 >Subject: [PATCH] Bug 33745: (follow-up) Add exception to 00-testcritic.t >Content-Type: text/plain; charset=utf-8 > >Test plan: >Run t/00-testcritic.t t/00-testcritic_2.t > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > t/00-testcritic.t | 7 +++++-- > t/00-testcritic_2.t | 16 ++++++++++++++++ > 2 files changed, 21 insertions(+), 2 deletions(-) > create mode 100755 t/00-testcritic_2.t > >diff --git a/t/00-testcritic.t b/t/00-testcritic.t >index cd3a7af71b..57935293ba 100755 >--- a/t/00-testcritic.t >+++ b/t/00-testcritic.t >@@ -9,9 +9,12 @@ use English qw(-no_match_vars); > eval { require Test::Perl::Critic; }; > > if ( $EVAL_ERROR ) { >- my $msg = 'Test::Perl::Critic required to criticise code,'; >+ my $msg = 'Test::Perl::Critic required to criticise code'; > plan( skip_all => $msg ); > } > > Test::Perl::Critic->import( -profile => '.perlcriticrc'); >-all_critic_ok('.'); >+# Test all perl files excluding Koha/Object.pm, see t/00-testcritic_2.t >+my $koha_object_module = ( -e 'Koha/Object.pm' ? '' : 'lib/' ) . 'Koha/Object.pm'; >+my @files = grep { $_ ne $koha_object_module } Perl::Critic::Utils::all_perl_files('.'); >+all_critic_ok( @files ); >diff --git a/t/00-testcritic_2.t b/t/00-testcritic_2.t >new file mode 100755 >index 0000000000..7885049661 >--- /dev/null >+++ b/t/00-testcritic_2.t >@@ -0,0 +1,16 @@ >+#!/usr/bin/env perl >+ >+# Running perlcritic on specific Koha files (as exception) >+ >+use Modern::Perl; >+use Test::More tests => 2; >+use English qw(-no_match_vars); >+ >+SKIP: { >+ eval { require Perl::Critic; }; >+ skip 'Perl::Critic required to criticise code', 2 if $EVAL_ERROR; >+ my $file = ( -e 'Koha/Object.pm' ? '' : 'lib/' ) . 'Koha/Object.pm'; >+ my @violations = Perl::Critic->new( -profile => '.perlcriticrc' )->critique($file); >+ is( @violations, 1, "One violation found in $file" ); >+ like( $violations[0], qr/Stricture disabled at line/, 'No strict refs found as expected' ); >+} >-- >2.30.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 33745
:
151273
|
151274
|
151275
|
151290
|
153449
|
153450
|
153451
|
153452
|
153510
|
153525
|
153584
|
153586