Bug 23104: Add tests for maxonsiteissueqty
[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     'errors',            'fix-perl-path.PL', 'help.pl',
23     'installer',         'koha_perl_deps.pl',
24     'kohaversion.pl',    'labels',
25     'mainpage.pl',       'Makefile.PL',
26     'members',           'misc',
27     'offline_circ',      'opac',
28     'patroncards',       'reports',
29     'reserve',           'reviews',
30     'rewrite-config.PL', 'rotating_collections',
31     'serials',           'services',
32     'skel',              'suggestion',
33     'svc',               'tags',
34     'tools',             'virtualshelves'
35 );
36
37 $Test::Strict::TEST_STRICT = 0;
38 $Test::Strict::TEST_SKIP = [ 'misc/kohalib.pl' ];
39
40 my $ncpu;
41 if ( $ENV{KOHA_PROVE_CPUS} ) {
42     $ncpu = $ENV{KOHA_PROVE_CPUS} ; # set number of cpus to use
43 } else {
44     $ncpu = Sys::CPU::cpu_count();
45 }
46
47 print "Using $ncpu CPUs...\n"
48     if $ENV{DEBUG};
49
50 my $pm   = new Parallel::ForkManager($ncpu);
51
52 foreach my $d (@dirs) {
53     $pm->start and next;    # do the fork
54
55     all_perl_files_ok($d);
56
57     $pm->finish;            # do the exit in the child process
58 }
59
60 $pm->wait_all_children;
61
62 done_testing();