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
a523a365
Commit
a523a365
authored
Nov 13, 2012
by
Simon Green
Committed by
Byron Jones
Nov 13, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 615627: Make t/012throwables.t know about user errors defined in extensions
r=dkl, a=LpSolit
parent
0bbec9ea
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
3 deletions
+20
-3
Extension.pm
extensions/Example/Extension.pm
+4
-2
012throwables.t
t/012throwables.t
+8
-1
Files.pm
t/Support/Files.pm
+8
-0
No files found.
extensions/Example/Extension.pm
View file @
a523a365
...
@@ -709,10 +709,12 @@ sub _check_short_desc {
...
@@ -709,10 +709,12 @@ sub _check_short_desc {
my
$invocant
=
shift
;
my
$invocant
=
shift
;
my
$value
=
$invocant
->
$original
(
@_
);
my
$value
=
$invocant
->
$original
(
@_
);
if
(
$value
!~
/example/i
)
{
if
(
$value
!~
/example/i
)
{
# U
ncomment
this line to make Bugzilla throw an error every time
# U
se
this line to make Bugzilla throw an error every time
# you try to file a bug or update a bug without the word "example"
# you try to file a bug or update a bug without the word "example"
# in the summary.
# in the summary.
#ThrowUserError('example_short_desc_invalid');
if
(
0
)
{
ThrowUserError
(
'example_short_desc_invalid'
);
}
}
}
return
$value
;
return
$value
;
}
}
...
...
t/012throwables.t
View file @
a523a365
...
@@ -47,6 +47,13 @@ foreach my $include_path (@include_paths) {
...
@@ -47,6 +47,13 @@ foreach my $include_path (@include_paths) {
$file =~ s|\\|/|g if ON_WINDOWS; # convert \ to / in path if on windows
$file =~ s|\\|/|g if ON_WINDOWS; # convert \ to / in path if on windows
$test_templates{$file} = ()
$test_templates{$file} = ()
if $file =~ m#global/(code|user)-error\.html\.tmpl#;
if $file =~ m#global/(code|user)-error\.html\.tmpl#;
# Make sure the extension is not disabled
if ($file =~ m#^(extensions/[^/]+/)#) {
$test_templates{$file} = ()
if ! -e "${1}disabled"
&& $file =~ m#global/(code|user)-error-errors\.html\.tmpl#;
}
}
}
}
}
...
@@ -59,7 +66,7 @@ plan tests => $tests;
...
@@ -59,7 +66,7 @@ plan tests => $tests;
# Collect all errors defined in templates
# Collect all errors defined in templates
foreach my $file (keys %test_templates) {
foreach my $file (keys %test_templates) {
$file =~ m|template/([^/]+).*/global/([^/]+)-error\.html\.tmpl|;
$file =~ m|template/([^/]+).*/global/([^/]+)-error
(?:-errors)?
\.html\.tmpl|;
my $lang = $1;
my $lang = $1;
my $errtype = $2;
my $errtype = $2;
...
...
t/Support/Files.pm
View file @
a523a365
...
@@ -16,6 +16,14 @@ use File::Find;
...
@@ -16,6 +16,14 @@ use File::Find;
find
(
sub
{
push
(
@files
,
$
File::Find::
name
)
if
$_
=~
/\.pm$/
;},
'Bugzilla'
);
find
(
sub
{
push
(
@files
,
$
File::Find::
name
)
if
$_
=~
/\.pm$/
;},
'Bugzilla'
);
push
(
@files
,
'extensions/create.pl'
);
push
(
@files
,
'extensions/create.pl'
);
my
@extensions
=
glob
(
'extensions/*'
);
foreach
my
$extension
(
@extensions
)
{
# Skip disabled extensions
next
if
-
e
"$extension/disabled"
;
find
(
sub
{
push
(
@files
,
$
File::Find::
name
)
if
$_
=~
/\.pm$/
;},
$extension
);
}
sub
isTestingFile
{
sub
isTestingFile
{
my
(
$file
)
=
@_
;
my
(
$file
)
=
@_
;
my
$exclude
;
my
$exclude
;
...
...
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