Bug 6679: catalogue/ now passing perl critic tests
[koha.git] / t / 00-testcritic.t
blobc97828b24b98697026ad85db1cc82d89a78be34c
1 #!/usr/bin/env perl
2 use strict;
3 use warnings;
5 # This script can be used to run perlcritic on perl files in koha
6 # It calls its own custom perlcriticrc
7 # The script is purely optional requiring Test::Perl::Critic to be installed
8 # and the environment variable TEST_QA to be set
9 # At present only the directories in @dirs will pass the tests in 'Gentle' mode
11 use File::Spec;
12 use Test::More;
13 use English qw(-no_match_vars);
15 my @all_koha_dirs = qw( acqui admin authorities basket C4 catalogue cataloguing circ debian errors
16 labels members misc offline_circ opac patroncards reports reserve reviews rotating_collections
17 serials sms suggestion t tags test tools virtualshelves);
19 my @dirs = qw( acqui admin authorities basket catalogue circ debian errors offline_circ reserve
20 reviews rotating_collections serials sms virtualshelves );
22 if ( not $ENV{TEST_QA} ) {
23 my $msg = 'Author test. Set $ENV{TEST_QA} to a true value to run';
24 plan( skip_all => $msg );
27 eval { require Test::Perl::Critic; };
29 if ( $EVAL_ERROR ) {
30 my $msg = 'Test::Perl::Critic required to criticise code,';
31 plan( skip_all => $msg );
34 my $rcfile = File::Spec->catfile( 't', 'perlcriticrc' );
35 Test::Perl::Critic->import( -profile => $rcfile);
36 all_critic_ok(@dirs);