Koha/t/db_dependent/00-strict.t
Jonathan Druart 238fabc4ab Bug 28617: Remove kohalib.pl and rely on PERL5LIB
The purpose of this script was to load the relevant Koha lib for the
different scripts (installation, cronjob, CLI, etc.)
However it is not used consistently and we prefer to rely on PERL5LIB.

From bug 28617 comment 6 from Galen:
"""
Time marches on, and one of the motivations for having kohalib.pl - making
it possible to install Koha without setting a single environment variable -
has been obviated by the vast improvements in the ease of installing Koha.

Consequently, I think kohalib.pl can go away.
"""

Test plan:
confirm that the changes make sense and that kohalib.pl can be removed
safely.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2021-12-07 12:16:28 -10:00

58 lines
1.4 KiB
Perl
Executable file

#!/usr/bin/perl
# This script is called by the pre-commit git hook to test modules compile
use strict;
use warnings;
use threads; # used for parallel
use Test::More;
use Test::Strict;
use Parallel::ForkManager;
use Sys::CPU;
use lib("misc/translator");
use lib("installer");
my @dirs = (
'acqui', 'admin',
'authorities', 'basket',
'catalogue', 'cataloguing',
'changelanguage.pl', 'circ',
'debian', 'docs',
'errors', 'fix-perl-path.PL', 'help.pl',
'installer', 'koha_perl_deps.pl',
'kohaversion.pl', 'labels',
'mainpage.pl', 'Makefile.PL',
'members', 'misc',
'offline_circ', 'opac',
'patroncards', 'reports',
'reserve', 'reviews',
'rewrite-config.PL', 'rotating_collections',
'serials', 'services',
'skel', 'suggestion',
'svc', 'tags',
'tools', 'virtualshelves'
);
$Test::Strict::TEST_STRICT = 0;
my $ncpu;
if ( $ENV{KOHA_PROVE_CPUS} ) {
$ncpu = $ENV{KOHA_PROVE_CPUS} ; # set number of cpus to use
} else {
$ncpu = Sys::CPU::cpu_count();
}
my $pm = Parallel::ForkManager->new($ncpu);
foreach my $d (@dirs) {
$pm->start and next; # do the fork
all_perl_files_ok($d);
$pm->finish; # do the exit in the child process
}
$pm->wait_all_children;
done_testing();