X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=t%2FSupport%2FFiles.pm;h=53103a27d25e5d4a510fba72b45ef940c3326297;hb=d64a64201767dd534ed86ac77dfcedf4a9c7c6f2;hp=d05f365e3019f682f9512adff0c91be5fce9c58d;hpb=9b220b885f1a1bb2a1201dfb1e0ae1e747a98c6c;p=kivitendo-erp.git diff --git a/t/Support/Files.pm b/t/Support/Files.pm index d05f365e3..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,9 +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) = @_; @@ -49,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}}; } @@ -73,7 +77,7 @@ sub isTestingFile { return undef; } -foreach $currentfile (@files) { +foreach my $currentfile (@files) { if (isTestingFile($currentfile)) { push(@testitems,$currentfile); }