X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=t%2FSupport%2FFiles.pm;h=53103a27d25e5d4a510fba72b45ef940c3326297;hb=65604fea85234a5ae3e787f7cafd81ece6b8621d;hp=e485561a35665a2c0c7954de3742685b6a333373;hpb=1d91e75c53e7da5bf2c1b334f5aeecf241dc5ec4;p=kivitendo-erp.git diff --git a/t/Support/Files.pm b/t/Support/Files.pm index e485561a3..53103a27d 100644 --- a/t/Support/Files.pm +++ b/t/Support/Files.pm @@ -20,16 +20,19 @@ # Contributor(s): Zach Lipton # Joel Peshkin - package Support::Files; +use strict; + use File::Find; +our @testitems; + # exclude_deps is a hash of arrays listing the files to be excluded # if a module is not available # -@additional_files = (); -%exclude_deps = ( +our @additional_files = (); +our %exclude_deps = ( 'XML::Twig' => ['importxml.pl'], 'Net::LDAP' => ['Bugzilla/Auth/Verify/LDAP.pm'], 'Email::Reply' => ['email_in.pl'], @@ -37,8 +40,10 @@ use File::Find; ); -@files = glob('*'); +our @files = glob('*'); find(sub { push(@files, $File::Find::name) if $_ =~ /\.pm$/;}, 'SL'); +find(sub { push(@files, $File::Find::name) if $_ =~ /\.pl$/;}, qw(bin/mozilla sql/Pg-upgrade2)); +find(sub { push(@files, $File::Find::name) if $_ =~ /\.html$/;}, qw(templates/webpages)); sub have_pkg { my ($pkg) = @_; @@ -48,8 +53,8 @@ sub have_pkg { return !($@); } -@exclude_files = (); -foreach $dep (keys(%exclude_deps)) { +our @exclude_files = (); +foreach my $dep (keys(%exclude_deps)) { if (!have_pkg($dep)) { push @exclude_files, @{$exclude_deps{$dep}}; } @@ -72,7 +77,7 @@ sub isTestingFile { return undef; } -foreach $currentfile (@files) { +foreach my $currentfile (@files) { if (isTestingFile($currentfile)) { push(@testitems,$currentfile); }