File: 01compile.t

package info (click to toggle)
fusioninventory-agent 1%3A2.6-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 27,488 kB
  • sloc: perl: 120,896; xml: 9,459; sh: 760; python: 26; makefile: 13
file content (60 lines) | stat: -rwxr-xr-x 1,992 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/usr/bin/perl

use strict;
use warnings;

use English qw(-no_match_vars);
use Test::More;
use UNIVERSAL::require;
use Config;

plan(skip_all => 'Test::Compile required')
    unless Test::Compile->require();
Test::Compile->import();

# use mock modules for non-available ones
if ($OSNAME eq 'MSWin32') {
    push @INC, 't/lib/fake/unix';
} else {
    push @INC, 't/lib/fake/windows';
}

# exclude linked modules
my @files = grep { filter($_) } Test::Compile::all_pm_files('lib');

Test::Compile::all_pm_files_ok(@files);

# filename-based filter
sub filter {

    if (!$Config{usethreads} || $Config{usethreads} ne 'define') {
        return 0 if $_ =~ m{FusionInventory/Agent/Task/NetInventory.pm};
        return 0 if $_ =~ m{FusionInventory/Agent/Task/NetDiscovery.pm};
        return 0 if $_ =~ m{FusionInventory/Agent/Task/WMI.pm};
        return 0 if $_ =~ m{FusionInventory/Agent/Tools/Win32.pm};
        return 0 if $_ =~ m{FusionInventory/Agent/Daemon/Win32.pm};
        return 0 if $_ =~ m{FusionInventory/Agent/Task/Inventory/Win32};
        return 0 if $_ =~ m{FusionInventory/Agent/Tools/Win32/WTS.pm};
        return 0 if $_ =~ m{FusionInventory/Agent/Task/Deploy/UserCheck/WTS.pm};
    }

    return 0 if ($_ =~ m{FusionInventory/Agent/Daemon/Win32.pm} &&
        !(Win32::Daemon->require()));

    return 0 if ($_ =~ m{FusionInventory/Agent/Task/Deploy.pm} &&
        !(File::Copy::Recursive->require()));

    return 0 if ($_ =~ m{FusionInventory/Agent/Task/Deploy/P2P.pm} &&
        !(Net::Ping->require() && Parallel::ForkManager->require()));

    return 0 if ($_ =~ m{FusionInventory/Agent/Task/Deploy/ActionProcessor.pm} &&
        !(File::Copy::Recursive->require()));

    return 0 if ($_ =~ m{FusionInventory/Agent/Task/Deploy/ActionProcessor/Action/Move.pm} &&
        !(File::Copy::Recursive->require()));

    return 0 if ($_ =~ m{FusionInventory/Agent/Task/Deploy/ActionProcessor/Action/Copy.pm} &&
        !(File::Copy::Recursive->require()));

    return 1;
}