Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
c246445a
Commit
c246445a
authored
Jun 23, 2011
by
David Lawrence
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 663835 - Extensions templates are not tested by the normal sanity test scripts
r/a=mkanat
parent
1b2a9741
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
34 deletions
+12
-34
004template.t
t/004template.t
+7
-10
Templates.pm
t/Support/Templates.pm
+5
-24
No files found.
t/004template.t
View file @
c246445a
...
...
@@ -66,16 +66,13 @@ sub existOnce {
# Check to make sure all templates that are referenced in
# Bugzilla exist in the proper place.
foreach
my
$lang
(
@languages
)
{
foreach
my
$file
(
@referenced_files
)
{
my
@path
=
map
(
File::
Spec
->
catfile
(
$_
,
$file
),
split
(
':'
,
$include_path
{
$lang
}
.
":"
.
$include_path
{
"en"
}));
if
(
my
$path
=
existOnce
(
@path
))
{
ok
(
1
,
"$path exists"
);
}
else
{
ok
(
0
,
"$file cannot be located --ERROR"
);
print
$fh
"Looked in:\n "
.
join
(
"\n "
,
@path
)
.
"\n"
;
}
foreach
my
$file
(
@referenced_files
)
{
my
@path
=
map
(
File::
Spec
->
catfile
(
$_
,
$file
),
@include_paths
);
if
(
my
$path
=
existOnce
(
@path
))
{
ok
(
1
,
"$path exists"
);
}
else
{
ok
(
0
,
"$file cannot be located --ERROR"
);
print
$fh
"Looked in:\n "
.
join
(
"\n "
,
@path
)
.
"\n"
;
}
}
...
...
t/Support/Templates.pm
View file @
c246445a
...
...
@@ -34,6 +34,8 @@ use base qw(Exporter);
use
vars
qw(@languages @include_paths %include_path @referenced_files
%actual_files $num_actual_files)
;
use
Bugzilla
;
use
Bugzilla::Install::
Util
qw(template_include_path)
;
use
Support::
Files
;
use
File::
Find
;
...
...
@@ -57,30 +59,9 @@ use File::Spec;
# total number of actual_files
$num_actual_files
=
0
;
# Scan for the template available languages and include paths
{
opendir
(
DIR
,
"template"
)
||
die
"Can't open 'template': $!"
;
my
@files
=
grep
{
/^[a-z-]+$/i
}
readdir
(
DIR
);
closedir
DIR
;
foreach
my
$langdir
(
@files
)
{
next
if
(
$langdir
=~
/^CVS$/i
);
my
$path
=
File::
Spec
->
catdir
(
'template'
,
$langdir
,
'custom'
);
my
@dirs
=
();
push
(
@dirs
,
$path
)
if
(
-
d
$path
);
$path
=
File::
Spec
->
catdir
(
'template'
,
$langdir
,
'extension'
);
push
(
@dirs
,
$path
)
if
(
-
d
$path
);
$path
=
File::
Spec
->
catdir
(
'template'
,
$langdir
,
'default'
);
push
(
@dirs
,
$path
)
if
(
-
d
$path
);
next
if
(
scalar
(
@dirs
)
==
0
);
push
(
@languages
,
$langdir
);
push
(
@include_paths
,
@dirs
);
$include_path
{
$langdir
}
=
join
(
":"
,
@dirs
);
}
}
# Set the template available languages and include paths
@languages
=
@
{
Bugzilla
->
languages
};
@include_paths
=
@
{
template_include_path
({
language
=>
Bugzilla
->
languages
})
};
my
@files
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment