summaryrefslogtreecommitdiffstats
path: root/t/Support
diff options
context:
space:
mode:
authorSimon Green <sgreen@redhat.com>2013-09-26 04:20:02 +0200
committerSimon Green <sgreen@redhat.com>2013-09-26 04:20:02 +0200
commit186374529e05a18e216ee96675d80488289c9c42 (patch)
treea9d7be657d39e1c8ad05c28320a9f6d7fa0b6690 /t/Support
parent52cbd16ef02a1098249758e30d12fc314926f3ef (diff)
downloadbugzilla-186374529e05a18e216ee96675d80488289c9c42.tar.gz
bugzilla-186374529e05a18e216ee96675d80488289c9c42.tar.xz
Bug 893589 - 004template.t fails when templates in extension directory
r=dkl, a=simon
Diffstat (limited to 't/Support')
-rw-r--r--t/Support/Files.pm8
-rw-r--r--t/Support/Templates.pm16
2 files changed, 16 insertions, 8 deletions
diff --git a/t/Support/Files.pm b/t/Support/Files.pm
index ed011a374..330a473b1 100644
--- a/t/Support/Files.pm
+++ b/t/Support/Files.pm
@@ -16,11 +16,11 @@ use File::Find;
find(sub { push(@files, $File::Find::name) if $_ =~ /\.pm$/;}, 'Bugzilla');
push(@files, 'extensions/create.pl');
-my @extensions = glob('extensions/*');
-foreach my $extension (@extensions) {
- # Skip disabled extensions
- next if -e "$extension/disabled";
+@extensions =
+ grep { $_ ne 'extensions/create.pl' && ! -e "$_/disabled" }
+ glob('extensions/*');
+foreach my $extension (@extensions) {
find(sub { push(@files, $File::Find::name) if $_ =~ /\.pm$/;}, $extension);
}
diff --git a/t/Support/Templates.pm b/t/Support/Templates.pm
index c9a528e9f..2185d687f 100644
--- a/t/Support/Templates.pm
+++ b/t/Support/Templates.pm
@@ -12,9 +12,9 @@ use strict;
use lib 't';
use parent qw(Exporter);
@Support::Templates::EXPORT =
- qw(@languages @include_paths $english_default_include_path
+ qw(@languages @include_paths @english_default_include_paths
%include_path @referenced_files %actual_files $num_actual_files);
-use vars qw(@languages @include_paths $english_default_include_path
+use vars qw(@languages @include_paths @english_default_include_paths
%include_path @referenced_files %actual_files $num_actual_files);
use Bugzilla;
@@ -34,10 +34,18 @@ use File::Spec;
# All include paths
@include_paths = ();
-# English default include path
-$english_default_include_path =
+# English default include paths
+push @english_default_include_paths,
File::Spec->catdir(bz_locations()->{'templatedir'}, 'en', 'default');
+# 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;
+ }
+}
+
# Files which are referenced in the cgi files
@referenced_files = ();