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;
}
|