summaryrefslogtreecommitdiffstats
path: root/t/Support
diff options
context:
space:
mode:
authorDylan William Hardison <dylan@hardison.net>2016-09-12 22:22:17 +0200
committerDylan William Hardison <dylan@hardison.net>2016-09-12 22:22:17 +0200
commit14bcdce1dc6029c3676c3640d8148c83c14692e5 (patch)
tree99d760e13b687f8111635916d9ed3937bc084c64 /t/Support
parente6bf4cacb10f86077fe898349485f5c7ab9fb4b6 (diff)
downloadbugzilla-14bcdce1dc6029c3676c3640d8148c83c14692e5.tar.gz
bugzilla-14bcdce1dc6029c3676c3640d8148c83c14692e5.tar.xz
Revert "Bug 1283930 - Add Makefile.PL & local/lib/perl5 support to bmo/master + local symlink to data/ directory"
Diffstat (limited to 't/Support')
-rw-r--r--t/Support/Files.pm61
-rw-r--r--t/Support/Systemexec.pm21
-rw-r--r--t/Support/Templates.pm70
3 files changed, 81 insertions, 71 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;
diff --git a/t/Support/Systemexec.pm b/t/Support/Systemexec.pm
index e73763f8f..676ee02a4 100644
--- a/t/Support/Systemexec.pm
+++ b/t/Support/Systemexec.pm
@@ -1,25 +1,14 @@
-# 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 -*-
package Support::Systemexec;
-
-use 5.10.1;
-use strict;
-use warnings;
-
-use parent qw(Exporter);
-@Support::Systemexec::EXPORT = qw(system exec);
-
+require Exporter;
+@ISA = qw(Exporter);
+@EXPORT = qw(system exec);
+@EXPORT_OK = qw();
sub system($$@) {
1;
}
-
sub exec($$@) {
1;
}
-
1;
diff --git a/t/Support/Templates.pm b/t/Support/Templates.pm
index 5071d67ae..81dc8cc3f 100644
--- a/t/Support/Templates.pm
+++ b/t/Support/Templates.pm
@@ -1,21 +1,38 @@
-# 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/.
+# -*- 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 Jacob Steenhagen.
+# Portions created by Jacob Steenhagen are
+# Copyright (C) 2001 Jacob Steenhagen. All
+# Rights Reserved.
+#
+# Contributor(s): Jacob Steenhagen <jake@bugzilla.org>
+# David D. Kilzer <ddkilzer@kilzer.net>
+# Tobias Burnus <burnus@net-b.de>
#
-# This Source Code Form is "Incompatible With Secondary Licenses", as
-# defined by the Mozilla Public License, v. 2.0.
package Support::Templates;
-use 5.10.1;
use strict;
-use warnings;
use lib 't';
use base qw(Exporter);
-@Support::Templates::EXPORT =
- qw(@languages @include_paths @english_default_include_paths
- %include_path @referenced_files %actual_files $num_actual_files);
+@Support::Templates::EXPORT =
+ qw(@languages @include_paths $english_default_include_path
+ %include_path @referenced_files %actual_files $num_actual_files);
+use vars qw(@languages @include_paths $english_default_include_path
+ %include_path @referenced_files %actual_files $num_actual_files);
use Bugzilla;
use Bugzilla::Constants;
@@ -25,32 +42,33 @@ use Support::Files;
use File::Find;
use File::Spec;
-# English default include paths
-our @english_default_include_paths =
- (File::Spec->catdir(bz_locations()->{'templatedir'}, 'en', 'default'));
+# The available template languages
+@languages = ();
-# And the extensions too
-foreach my $extension (@Support::Files::extensions) {
- my $dir = File::Spec->catdir($extension, 'template', 'en', 'default');
- if (-e $dir) {
- push @english_default_include_paths, $dir;
- }
-}
+# The colon separated includepath per language
+%include_path = ();
+
+# All include paths
+@include_paths = ();
+
+# English default include path
+$english_default_include_path =
+ File::Spec->catdir(bz_locations()->{'templatedir'}, 'en', 'default');
# Files which are referenced in the cgi files
-our @referenced_files = ();
+@referenced_files = ();
# All files sorted by include_path
-our %actual_files = ();
+%actual_files = ();
# total number of actual_files
-our $num_actual_files = 0;
+$num_actual_files = 0;
# Set the template available languages and include paths
-our @languages = @{ Bugzilla->languages };
-our @include_paths = @{ template_include_path({ language => Bugzilla->languages }) };
+@languages = @{ Bugzilla->languages };
+@include_paths = @{ template_include_path({ language => Bugzilla->languages }) };
-our @files;
+my @files;
# Local subroutine used with File::Find
sub find_templates {