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;
40 if ( $ENV{KOHA_PROVE_CPUS} ) {
41 $ncpu = $ENV{KOHA_PROVE_CPUS} ; # set number of cpus to use
43 $ncpu = Sys::CPU::cpu_count();
46 my $pm = Parallel::ForkManager->new($ncpu);
48 foreach my $d (@dirs) {
49 $pm->start and next; # do the fork
51 all_perl_files_ok($d);
53 $pm->finish; # do the exit in the child process
56 $pm->wait_all_children;