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_JENKINS} ) {
43 $ncpu = 2; # works fastest on kc.org jenkins box
45 $ncpu = Sys::CPU::cpu_count();
48 my $pm = new Parallel::ForkManager($ncpu);
50 foreach my $d (@dirs) {
51 $pm->start and next; # do the fork
53 all_perl_files_ok($d);
55 $pm->finish; # do the exit in the child process
58 $pm->wait_all_children;