From 934948d1e59b99f23083e73c17344806cd25084b Mon Sep 17 00:00:00 2001 From: "jake%acutex.net" <> Date: Sun, 7 Oct 2001 04:37:20 +0000 Subject: 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 --- t/Support/Templates.pm | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 't/Support/Templates.pm') 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 = ; + close (FILE); + foreach my $line (@lines) { + if ($line =~ m/\[% INCLUDE (.+?) /) { + my $template = $1; + push (@testitems, $template) unless $t{$template}; + $t{$template} = 1; + } + } +} + 1; -- cgit v1.2.3-24-g4f1b