Bug 9302: (QA follow-up) Consistency follow-up
[koha.git] / t / db_dependent / 00-strict.t
blob4f3c9e4d278022448bf876a5cf91bb5e7f578f53
1 #!/usr/bin/perl
2 # This script is called by the pre-commit git hook to test modules compile
4 use strict;
5 use warnings;
7 use threads; # used for parallel
8 use Test::More;
9 use Test::Strict;
10 use Parallel::ForkManager;
11 use Sys::CPU;
13 use lib("misc/translator");
14 use lib("installer");
16 my @dirs = (
17 'acqui', 'admin',
18 'authorities', 'basket',
19 'catalogue', 'cataloguing',
20 'changelanguage.pl', 'circ',
21 'debian', 'docs',
22 'edithelp.pl', 'errors',
23 'fix-perl-path.PL', 'help.pl',
24 'installer', 'koha_perl_deps.pl',
25 'kohaversion.pl', 'labels',
26 'mainpage.pl', 'Makefile.PL',
27 'members', 'misc',
28 'offline_circ', 'opac',
29 'patroncards', 'reports',
30 'reserve', 'reviews',
31 'rewrite-config.PL', 'rotating_collections',
32 'serials', 'services',
33 'skel', 'suggestion',
34 'svc', 'tags',
35 'tools', 'virtualshelves'
38 $Test::Strict::TEST_STRICT = 0;
39 $Test::Strict::TEST_SKIP = [ 'misc/kohalib.pl', 'misc/plack/koha.psgi' ];
41 my $ncpu;
42 if ( $ENV{KOHA_PROVE_CPUS} ) {
43 $ncpu = $ENV{KOHA_PROVE_CPUS} ; # set number of cpus to use
44 } else {
45 $ncpu = Sys::CPU::cpu_count();
48 print "Using $ncpu CPUs...\n"
49 if $ENV{DEBUG};
51 my $pm = new Parallel::ForkManager($ncpu);
53 foreach my $d (@dirs) {
54 $pm->start and next; # do the fork
56 all_perl_files_ok($d);
58 $pm->finish; # do the exit in the child process
61 $pm->wait_all_children;
63 done_testing();