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, 29 insertions, 32 deletions
diff --git a/t/Support/Files.pm b/t/Support/Files.pm
index 00e0efd34..1bdf2eac7 100644
--- a/t/Support/Files.pm
+++ b/t/Support/Files.pm
@@ -1,45 +1,40 @@
-# -*- 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>
+# 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.
package Support::Files;
-use Bugzilla;
+use 5.10.1;
+use strict;
+use warnings;
use File::Find;
+our @additional_files = ();
+
use constant IGNORE => qw(
Bugzilla/DuoAPI.pm
Bugzilla/DuoWeb.pm
);
-@additional_files = ();
+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);
+}
-@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');
+our @test_files = glob('t/*.t xt/*/*.t');
-my @extensions = glob('extensions/*');
foreach my $extension (@extensions) {
# Skip disabled extensions
next if -e "$extension/disabled";
@@ -55,7 +50,7 @@ sub isTestingFile {
return undef if $ignore eq $file;
}
- if ($file =~ /\.cgi$|\.pl$|\.pm$/) {
+ if ($file =~ /\.psgi$|\.cgi$|\.pl$|\.pm$/) {
return 1;
}
my $additional;
@@ -65,11 +60,13 @@ sub isTestingFile {
return undef;
}
-foreach $currentfile (@files) {
+our (@testitems, @module_files);
+
+foreach my $currentfile (@files) {
if (isTestingFile($currentfile)) {
- push(@testitems,$currentfile);
+ push(@testitems, $currentfile);
}
+ push(@module_files, $currentfile) if $currentfile =~ /\.pm$/;
}
-
1;