summaryrefslogtreecommitdiffstats
path: root/t/Support
diff options
context:
space:
mode:
authorjake%acutex.net <>2001-10-07 06:37:20 +0200
committerjake%acutex.net <>2001-10-07 06:37:20 +0200
commit934948d1e59b99f23083e73c17344806cd25084b (patch)
treef473c8c330f3fd286c6b210aa7dff502cb1d4f60 /t/Support
parent1c921c81914e23bd762921575d3903d19f8072bc (diff)
downloadbugzilla-934948d1e59b99f23083e73c17344806cd25084b.tar.gz
bugzilla-934948d1e59b99f23083e73c17344806cd25084b.tar.xz
We also need to look for templates that are INCLUDEd in other templates.
No review needed for tests at this time. NOT PART OF BUILD
Diffstat (limited to 't/Support')
-rw-r--r--t/Support/Templates.pm17
1 files changed, 17 insertions, 0 deletions
diff --git a/t/Support/Templates.pm b/t/Support/Templates.pm
index 360fdc4cc..8ae392681 100644
--- a/t/Support/Templates.pm
+++ b/t/Support/Templates.pm
@@ -22,6 +22,8 @@
package Support::Templates;
+$include_path = "template/default";
+
# Scan Bugzilla's code looking for templates used and put them
# in the @testitems array to be used by the template.t test.
@@ -41,4 +43,19 @@ foreach my $file (@files) {
}
}
+# Now let's look at the templates and find any other templates
+# that are INCLUDEd.
+foreach my $file(@testitems) {
+ open (FILE, $include_path . "/" . $file) || next;
+ my @lines = <FILE>;
+ close (FILE);
+ foreach my $line (@lines) {
+ if ($line =~ m/\[% INCLUDE (.+?) /) {
+ my $template = $1;
+ push (@testitems, $template) unless $t{$template};
+ $t{$template} = 1;
+ }
+ }
+}
+
1;