2 # This script is called by the pre-commit git hook to test modules compile
7 use threads
; # used for parallel
10 use Parallel
::ForkManager
;
13 use lib
("misc/translator");
18 'authorities', 'basket',
19 'catalogue', 'cataloguing',
20 'changelanguage.pl', 'circ',
22 'errors', 'fix-perl-path.PL', 'help.pl',
23 'installer', 'koha_perl_deps.pl',
24 'kohaversion.pl', 'labels',
25 'mainpage.pl', 'Makefile.PL',
27 'offline_circ', 'opac',
28 'patroncards', 'reports',
30 'rewrite-config.PL', 'rotating_collections',
31 'serials', 'services',
34 'tools', 'virtualshelves'
37 $Test::Strict
::TEST_STRICT
= 0;
38 $Test::Strict
::TEST_SKIP
= [ 'misc/kohalib.pl' ];
41 if ( $ENV{KOHA_PROVE_CPUS
} ) {
42 $ncpu = $ENV{KOHA_PROVE_CPUS
} ; # set number of cpus to use
44 $ncpu = Sys
::CPU
::cpu_count
();
47 print "Using $ncpu CPUs...\n"
50 my $pm = new Parallel
::ForkManager
($ncpu);
52 foreach my $d (@dirs) {
53 $pm->start and next; # do the fork
55 all_perl_files_ok
($d);
57 $pm->finish; # do the exit in the child process
60 $pm->wait_all_children;