Bug 16330: Move patches to OpenAPI
[koha.git] / t / db_dependent / 00-strict.t
1 #!/usr/bin/perl
2 # This script is called by the pre-commit git hook to test modules compile
3
4 use strict;
5 use warnings;
6
7 use threads;    # used for parallel
8 use Test::More;
9 use Test::Strict;
10 use Parallel::ForkManager;
11 use Sys::CPU;
12
13 use lib("misc/translator");
14 use lib("installer");
15
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'
36 );
37
38 $Test::Strict::TEST_STRICT = 0;
39 $Test::Strict::TEST_SKIP = [ 'misc/kohalib.pl', 'misc/plack/koha.psgi' ];
40
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();
46 }
47
48 print "Using $ncpu CPUs...\n"
49     if $ENV{DEBUG};
50
51 my $pm   = new Parallel::ForkManager($ncpu);
52
53 foreach my $d (@dirs) {
54     $pm->start and next;    # do the fork
55
56     all_perl_files_ok($d);
57
58     $pm->finish;            # do the exit in the child process
59 }
60
61 $pm->wait_all_children;
62
63 done_testing();