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
17867ff9
Commit
17867ff9
authored
Jun 16, 2010
by
Max Kanat-Alexander
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 559999: Make t/010dependencies.t consider "use base" to be just like "use"
r=timello, a=mkanat
parent
67cf215f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
9 deletions
+19
-9
010dependencies.t
t/010dependencies.t
+19
-9
No files found.
t/010dependencies.t
View file @
17867ff9
...
...
@@ -21,8 +21,7 @@
## dependencies ##
use
strict
;
use
lib
't'
;
use
lib
qw(. lib t)
;
use
Support::
Files
;
use
Test::
More
qw(no_plan)
;
...
...
@@ -30,6 +29,16 @@ use Test::More qw(no_plan);
my
%
mods
;
my
%
deps
;
use
constant
MODULE_REGEX
=>
qr/
(?:(?:^\s*use)
|
(?:^require)
)\s+
['"]?
([\w:\.\\]+)
/
x
;
use
constant
BASE_REGEX
=>
qr/^use base qw\(([^\)]+)/
;
# Extract all Perl modules.
foreach
my
$file
(
@
Support::Files::
testitems
)
{
if
(
$file
=~
/^(.*)\.pm$/
)
{
...
...
@@ -58,18 +67,19 @@ foreach my $module (keys %mods) {
if
(
$line
=~
/^package\s+([^;]);/
)
{
$module
=
$1
;
}
elsif
(
$line
=~
/^\s*(?:use|^require) *"?(Bugzilla.*?)"?(?:;|\s+qw[\(\{]|\s+\(\))/
)
{
my
$used
=
$1
;
elsif
(
$line
=~
BASE_REGEX
or
$line
=~
MODULE_REGEX
)
{
my
$used_string
=
$1
;
# "use base" can have multiple modules
my
@used_array
=
split
(
/\s+/
,
$used_string
);
foreach
my
$used
(
@used_array
)
{
next
if
$used
!~
/^Bugzilla/
;
$used
=~
s
#/#::#g;
$used
=~
s
#\.pm$##;
$used
=~
s
#\$module#[^:]+#;
$used
=~
s
#\${[^}]+}#[^:]+#;
$used
=~
s
#[" ]##g;
my
$exclude
=
""
;
if
(
$used
eq
'Bugzilla::Auth::Login::[^:]+'
)
{
$exclude
=
'Bugzilla::Auth::Login::Stack'
}
elsif
(
$used
eq
'Bugzilla::Auth::Verify::[^:]+'
)
{
$exclude
=
'Bugzilla::Auth::Verify::Stack'
}
elsif
(
$used
eq
'Bugzilla::Config::[^:]+'
)
{
$exclude
=
'Bugzilla::Config::Common'
}
push
(
@use
,
grep
(
/^$used$/
,
grep
(
!
/^$exclude$/
,
keys
%
mods
)));
push
(
@use
,
grep
(
/^\Q$used\E$/
,
keys
%
mods
));
}
}
}
close
(
SOURCE
);
...
...
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