View | Details | Raw Unified | Return to bug 18897
Collapse All | Expand All

(-)a/t/db_dependent/00-strict.t (-2 / +20 lines)
Lines 2-7 Link Here
2
2
3
use strict;
3
use strict;
4
use warnings;
4
use warnings;
5
use Module::Load::Conditional qw[can_load check_install requires];
5
use Test::More;
6
use Test::More;
6
use Test::Strict;
7
use Test::Strict;
7
use File::Spec;
8
use File::Spec;
Lines 19-24 my @dirs = ( 'acqui', 'admin', 'authorities', 'basket', Link Here
19
    'sms', 'suggestion', 'svc', 'tags', 'tools', 'virtualshelves' );
20
    'sms', 'suggestion', 'svc', 'tags', 'tools', 'virtualshelves' );
20
21
21
$Test::Strict::TEST_STRICT = 0;
22
$Test::Strict::TEST_STRICT = 0;
22
$Test::Strict::TEST_SKIP = [ 'misc/kohalib.pl', 'sms/sms_listen_windows_start.pl', 'misc/plack/koha.psgi' ];
23
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' ];
26
my @skips;
27
push @skips,@$general_skips;
28
if ( ! can_load(
29
    modules => { 'Koha::SearchEngine::Elasticsearch::Indexer' => undef, } )
30
) {
31
    my $missing_module;
32
    if ( $Module::Load::Conditional::ERROR =~ /Can\'t locate (.*?) / ) {
33
        $missing_module = $1;
34
    }
35
    my $es_dep_msg = "Required module $missing_module is not installed";
36
    diag $es_dep_msg;
37
    my $skip_what_msg = "Skipping: " . join ',', @$elastic_search_files;
38
    diag $skip_what_msg;
39
    push @skips, @$elastic_search_files;
40
}
41
push @$Test::Strict::TEST_SKIP, @skips;
23
42
24
all_perl_files_ok(@dirs);
43
all_perl_files_ok(@dirs);
25
- 

Return to bug 18897