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
12 use English qw(-no_match_vars);
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 );
42 eval { require Test::Perl::Critic; };
45 my $msg = 'Test::Perl::Critic required to criticise code,';
46 plan( skip_all => $msg );
49 my $rcfile = File::Spec->catfile( 't', 'perlcriticrc' );
50 Test::Perl::Critic->import( -profile => $rcfile);