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 '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',
28 'offline_circ', 'opac',
29 'patroncards', 'reports',
31 'rewrite-config.PL', 'rotating_collections',
32 'serials', 'services',
35 'tools', 'virtualshelves'
38 $Test::Strict::TEST_STRICT = 0;
39 $Test::Strict::TEST_SKIP = [ 'misc/kohalib.pl', 'misc/plack/koha.psgi' ];
42 if ( $ENV{KOHA_PROVE_CPUS} ) {
43 $ncpu = $ENV{KOHA_PROVE_CPUS} ; # set number of cpus to use
45 $ncpu = Sys::CPU::cpu_count();
48 print "Using $ncpu CPUs...\n"
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;