From 4b2c9f0f96242fcd5395c088de4e27bffbfb8085 Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" <> Date: Tue, 10 Nov 2009 21:19:46 +0000 Subject: Bug 527505: Make 001compile.t use Bugzilla->feature to determine which modules to compile Patch by Max Kanat-Alexander r=LpSolit, a=mkanat --- t/Support/Files.pm | 30 ------------------------------ 1 file changed, 30 deletions(-) (limited to 't/Support/Files.pm') diff --git a/t/Support/Files.pm b/t/Support/Files.pm index 07f1c2f6c..d24cc2264 100644 --- a/t/Support/Files.pm +++ b/t/Support/Files.pm @@ -25,44 +25,14 @@ package Support::Files; use File::Find; -# exclude_deps is a hash of arrays listing the files to be excluded -# if a module is not available -# @additional_files = (); -%exclude_deps = ( - 'XML::Twig' => ['importxml.pl'], - 'Net::LDAP' => ['Bugzilla/Auth/Verify/LDAP.pm'], - 'Authen::Radius' => ['Bugzilla/Auth/Verify/RADIUS.pm'], - 'Email::Reply' => ['email_in.pl'], - 'Email::MIME::Attachment::Stripper' => ['email_in.pl'], - 'JSON::RPC' => ['Bugzilla/WebService/Server/JSONRPC.pm'] -); - @files = glob('*'); find(sub { push(@files, $File::Find::name) if $_ =~ /\.pm$/;}, 'Bugzilla'); -sub have_pkg { - my ($pkg) = @_; - my ($msg, $vnum, $vstr); - no strict 'refs'; - eval { my $p; ($p = $pkg . ".pm") =~ s!::!/!g; require $p; }; - return !($@); -} - -@exclude_files = (); -foreach $dep (keys(%exclude_deps)) { - if (!have_pkg($dep)) { - push @exclude_files, @{$exclude_deps{$dep}}; - } -} - sub isTestingFile { my ($file) = @_; my $exclude; - foreach $exclude (@exclude_files) { - if ($file eq $exclude) { return undef; } # get rid of excluded files. - } if ($file =~ /\.cgi$|\.pl$|\.pm$/) { return 1; -- cgit v1.2.3-24-g4f1b