summaryrefslogtreecommitdiffstats
path: root/t/Support/Files.pm
diff options
context:
space:
mode:
Diffstat (limited to 't/Support/Files.pm')
-rw-r--r--t/Support/Files.pm61
1 files changed, 32 insertions, 29 deletions
diff --git a/t/Support/Files.pm b/t/Support/Files.pm
index 1bdf2eac7..00e0efd34 100644
--- a/t/Support/Files.pm
+++ b/t/Support/Files.pm
@@ -1,40 +1,45 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This Source Code Form is "Incompatible With Secondary Licenses", as
-# defined by the Mozilla Public License, v. 2.0.
+# -*- Mode: perl; indent-tabs-mode: nil -*-
+#
+# The contents of this file are subject to the Mozilla Public
+# License Version 1.1 (the "License"); you may not use this file
+# except in compliance with the License. You may obtain a copy of
+# the License at http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS
+# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+# implied. See the License for the specific language governing
+# rights and limitations under the License.
+#
+# The Original Code are the Bugzilla Tests.
+#
+# The Initial Developer of the Original Code is Zach Lipton
+# Portions created by Zach Lipton are
+# Copyright (C) 2001 Zach Lipton. All
+# Rights Reserved.
+#
+# Contributor(s): Zach Lipton <zach@zachlipton.com>
+# Joel Peshkin <bugreport@peshkin.net>
package Support::Files;
-use 5.10.1;
-use strict;
-use warnings;
+use Bugzilla;
use File::Find;
-our @additional_files = ();
-
use constant IGNORE => qw(
Bugzilla/DuoAPI.pm
Bugzilla/DuoWeb.pm
);
-our @files = glob('*');
-find(sub { push(@files, $File::Find::name) if $_ =~ /\.pm$/;}, qw(Bugzilla docs));
-push(@files, 'extensions/create.pl', 'docs/makedocs.pl', 'cpanfile');
-
-our @extensions =
- grep { $_ ne 'extensions/create.pl' && ! -e "$_/disabled" }
- glob('extensions/*');
-
-foreach my $extension (@extensions) {
- find(sub { push(@files, $File::Find::name) if $_ =~ /\.pm$/;}, $extension);
-}
+@additional_files = ();
-our @test_files = glob('t/*.t xt/*/*.t');
+@files = glob('*');
+my @extension_paths = map { $_->package_dir } @{ Bugzilla->extensions };
+find(sub { push(@files, $File::Find::name) if $_ =~ /\.pm$/;}, 'Bugzilla', @extension_paths);
+push(@files, 'extensions/create.pl');
+my @extensions = glob('extensions/*');
foreach my $extension (@extensions) {
# Skip disabled extensions
next if -e "$extension/disabled";
@@ -50,7 +55,7 @@ sub isTestingFile {
return undef if $ignore eq $file;
}
- if ($file =~ /\.psgi$|\.cgi$|\.pl$|\.pm$/) {
+ if ($file =~ /\.cgi$|\.pl$|\.pm$/) {
return 1;
}
my $additional;
@@ -60,13 +65,11 @@ sub isTestingFile {
return undef;
}
-our (@testitems, @module_files);
-
-foreach my $currentfile (@files) {
+foreach $currentfile (@files) {
if (isTestingFile($currentfile)) {
- push(@testitems, $currentfile);
+ push(@testitems,$currentfile);
}
- push(@module_files, $currentfile) if $currentfile =~ /\.pm$/;
}
+
1;