Revision 9dbf04d6
Von Moritz Bunkus vor fast 8 Jahren hinzugefügt
t/Support/Files.pm | ||
---|---|---|
20 | 20 |
# Contributor(s): Zach Lipton <zach@zachlipton.com> |
21 | 21 |
# Joel Peshkin <bugreport@peshkin.net> |
22 | 22 |
|
23 |
|
|
24 | 23 |
package Support::Files; |
25 | 24 |
|
25 |
use strict; |
|
26 |
|
|
26 | 27 |
use File::Find; |
27 | 28 |
|
29 |
our @testitems; |
|
30 |
|
|
28 | 31 |
# exclude_deps is a hash of arrays listing the files to be excluded |
29 | 32 |
# if a module is not available |
30 | 33 |
# |
31 |
@additional_files = (); |
|
32 |
%exclude_deps = ( |
|
34 |
our @additional_files = ();
|
|
35 |
our %exclude_deps = (
|
|
33 | 36 |
'XML::Twig' => ['importxml.pl'], |
34 | 37 |
'Net::LDAP' => ['Bugzilla/Auth/Verify/LDAP.pm'], |
35 | 38 |
'Email::Reply' => ['email_in.pl'], |
... | ... | |
37 | 40 |
); |
38 | 41 |
|
39 | 42 |
|
40 |
@files = glob('*'); |
|
43 |
our @files = glob('*');
|
|
41 | 44 |
find(sub { push(@files, $File::Find::name) if $_ =~ /\.pm$/;}, 'SL'); |
42 | 45 |
find(sub { push(@files, $File::Find::name) if $_ =~ /\.pl$/;}, qw(bin/mozilla sql/Pg-upgrade2)); |
43 | 46 |
find(sub { push(@files, $File::Find::name) if $_ =~ /\.html$/;}, qw(templates/webpages)); |
... | ... | |
50 | 53 |
return !($@); |
51 | 54 |
} |
52 | 55 |
|
53 |
@exclude_files = (); |
|
54 |
foreach $dep (keys(%exclude_deps)) { |
|
56 |
our @exclude_files = ();
|
|
57 |
foreach my $dep (keys(%exclude_deps)) {
|
|
55 | 58 |
if (!have_pkg($dep)) { |
56 | 59 |
push @exclude_files, @{$exclude_deps{$dep}}; |
57 | 60 |
} |
... | ... | |
74 | 77 |
return undef; |
75 | 78 |
} |
76 | 79 |
|
77 |
foreach $currentfile (@files) { |
|
80 |
foreach my $currentfile (@files) {
|
|
78 | 81 |
if (isTestingFile($currentfile)) { |
79 | 82 |
push(@testitems,$currentfile); |
80 | 83 |
} |
Auch abrufbar als: Unified diff
t/Support/Files: auf strict umgestellt