Commit f987a550 authored by burnus%gmx.de's avatar burnus%gmx.de

Bug 203318 - 008filter.t fails to do chdir $topdir - if…

Bug 203318 - 008filter.t fails to do chdir $topdir - if @Support::Templates::include_paths returns more than one path r=justdave,gerv a=justdave
parent 773fe494
...@@ -41,14 +41,17 @@ use Cwd; ...@@ -41,14 +41,17 @@ use Cwd;
# Undefine the record separator so we can read in whole files at once # Undefine the record separator so we can read in whole files at once
my $oldrecsep = $/; my $oldrecsep = $/;
$/ = undef;
my $topdir = cwd; my $topdir = cwd;
$/ = undef;
foreach my $path (@Support::Templates::include_paths) { foreach my $path (@Support::Templates::include_paths) {
$path =~ m|template/([^/]+)/|; $path =~ m|template/([^/]+)/([^/]+)|;
my $lang = $1; my $lang = $1;
my $flavor = $2;
chdir $topdir; # absolute path chdir $topdir; # absolute path
my @testitems = Support::Templates::find_actual_files($path); my @testitems = Support::Templates::find_actual_files($path);
chdir $topdir; # absolute path
next unless @testitems; next unless @testitems;
...@@ -79,7 +82,7 @@ foreach my $path (@Support::Templates::include_paths) { ...@@ -79,7 +82,7 @@ foreach my $path (@Support::Templates::include_paths) {
# There are some files we don't check, because there is no need to # There are some files we don't check, because there is no need to
# filter their contents due to their content-type. # filter their contents due to their content-type.
if ($file =~ /\.(txt|png)\.tmpl$/) { if ($file =~ /\.(txt|png)\.tmpl$/) {
ok(1, "($lang) $file is filter-safe"); ok(1, "($lang/$flavor) $file is filter-safe");
next; next;
} }
...@@ -155,7 +158,7 @@ foreach my $path (@Support::Templates::include_paths) { ...@@ -155,7 +158,7 @@ foreach my $path (@Support::Templates::include_paths) {
if (@unfiltered) { if (@unfiltered) {
my $uflist = join("\n ", @unfiltered); my $uflist = join("\n ", @unfiltered);
ok(0, "($lang) $fullpath has unfiltered directives:\n $uflist\n--ERROR"); ok(0, "($lang/$flavor) $fullpath has unfiltered directives:\n $uflist\n--ERROR");
} }
else { else {
# Find any members of the exclusion list which were not found # Find any members of the exclusion list which were not found
...@@ -166,12 +169,12 @@ foreach my $path (@Support::Templates::include_paths) { ...@@ -166,12 +169,12 @@ foreach my $path (@Support::Templates::include_paths) {
if (@notfound) { if (@notfound) {
my $nflist = join("\n ", @notfound); my $nflist = join("\n ", @notfound);
ok(0, "($lang) $fullpath - FEL has extra members:\n $nflist\n" . ok(0, "($lang/$flavor) $fullpath - FEL has extra members:\n $nflist\n" .
"--WARNING"); "--WARNING");
} }
else { else {
# Don't use the full path here - it's too long and unwieldy. # Don't use the full path here - it's too long and unwieldy.
ok(1, "($lang) $file is filter-safe"); ok(1, "($lang/$flavor) $file is filter-safe");
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment