1 # This script is called by the pre-commit git hook to test modules compile
5 use Module::Load::Conditional qw[can_load check_install requires];
10 use lib("misc/translator");
13 my @dirs = ( 'acqui', 'admin', 'authorities', 'basket',
14 'catalogue', 'cataloguing', 'changelanguage.pl', 'circ', 'debian', 'docs',
15 'edithelp.pl', 'errors', 'fix-perl-path.PL', 'help.pl', 'installer',
16 'koha_perl_deps.pl', 'kohaversion.pl', 'labels',
17 'mainpage.pl', 'Makefile.PL', 'members', 'misc', 'offline_circ', 'opac',
18 'patroncards', 'reports', 'reserve', 'reviews',
19 'rewrite-config.PL', 'rotating_collections', 'serials', 'services', 'skel',
20 'sms', 'suggestion', 'svc', 'tags', 'tools', 'virtualshelves' );
22 $Test::Strict::TEST_STRICT = 0;
24 my $general_skips = [ 'misc/kohalib.pl', 'sms/sms_listen_windows_start.pl', 'misc/plack/koha.psgi' ];
25 my $elastic_search_files = [ 'misc/search_tools/rebuild_elastic_search.pl' ];
27 push @skips,@$general_skips;
29 modules => { 'Koha::SearchEngine::Elasticsearch::Indexer' => undef, } )
32 if ( $Module::Load::Conditional::ERROR =~ /Can\'t locate (.*?) / ) {
35 my $es_dep_msg = "Required module $missing_module is not installed";
37 my $skip_what_msg = "Skipping: " . join ',', @$elastic_search_files;
39 push @skips, @$elastic_search_files;
41 push @$Test::Strict::TEST_SKIP, @skips;
43 all_perl_files_ok(@dirs);