Bug 15758: Koha::Libraries - Remove GetBranchesLoop
[koha.git] / t / 00-testcritic.t
1 #!/usr/bin/env perl
2
3 # This script can be used to run perlcritic on perl files in koha
4 # It calls its own custom perlcriticrc
5 # The script is purely optional requiring Test::Perl::Critic to be installed 
6 # and the environment variable TEST_QA to be set
7 # At present only the directories in @dirs will pass the tests in 'Gentle' mode
8
9 use Modern::Perl;
10 use File::Spec;
11 use Test::More;
12 use English qw(-no_match_vars);
13
14 my @dirs = qw(
15     acqui
16     admin
17     authorities
18     basket
19     catalogue
20     cataloguing
21     circ
22     debian
23     errors
24     labels
25     members
26     offline_circ
27     reserve
28     reviews
29     rotating_collections
30     serials
31     sms
32     virtualshelves
33     Koha
34     C4/SIP
35 );
36
37 if ( not $ENV{TEST_QA} ) {
38     my $msg = 'Author test. Set $ENV{TEST_QA} to a true value to run';
39     plan( skip_all => $msg );
40 }
41
42 eval { require Test::Perl::Critic; };
43
44 if ( $EVAL_ERROR ) {
45     my $msg = 'Test::Perl::Critic required to criticise code,';
46     plan( skip_all => $msg );
47 }
48
49 my $rcfile = File::Spec->catfile( 't', 'perlcriticrc' );
50 Test::Perl::Critic->import( -profile => $rcfile);
51 all_critic_ok(@dirs);
52