Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
fcc3a7a4
Commit
fcc3a7a4
authored
Oct 05, 2007
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal:/home/bk/mysql-5.1-maint
into shellback.(none):/home/msvensson/mysql/mysql-5.1-maint
parents
ad38ac6e
fb6b258e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
80 additions
and
60 deletions
+80
-60
mysql-test/lib/mtr_cases.pl
mysql-test/lib/mtr_cases.pl
+80
-60
No files found.
mysql-test/lib/mtr_cases.pl
View file @
fcc3a7a4
...
@@ -48,13 +48,14 @@ sub collect_test_cases ($) {
...
@@ -48,13 +48,14 @@ sub collect_test_cases ($) {
{
{
# Check that the tests specified was found
# Check that the tests specified was found
# in at least one suite
# in at least one suite
foreach
my
$t
name
(
@::opt_cases
)
foreach
my
$t
est_name_spec
(
@::opt_cases
)
{
{
my
$found
=
0
;
my
$found
=
0
;
my
(
$sname
,
$tname
,
$extension
)
=
split_testname
(
$test_name_spec
);
foreach
my
$test
(
@$cases
)
foreach
my
$test
(
@$cases
)
{
{
if
(
$test
->
{'
name
'}
eq
$tname
||
# test->{name} is always in suite.name format
mtr_match_extension
(
$test
->
{'
name
'},
$tname
)
)
if
(
$test
->
{
name
}
=~
/.*\.$tname/
)
{
{
$found
=
1
;
$found
=
1
;
}
}
...
@@ -144,6 +145,45 @@ sub collect_test_cases ($) {
...
@@ -144,6 +145,45 @@ sub collect_test_cases ($) {
}
}
# Valid extensions and their corresonding component id
my
%
exts
=
(
'
test
'
=>
'
mysqld
',
'
imtest
'
=>
'
im
'
);
# Returns (suitename, testname, extension)
sub
split_testname
{
my
(
$test_name
)
=
@_
;
# Get rid of directory part and split name on .'s
my
@parts
=
split
(
/\./
,
basename
(
$test_name
));
if
(
@parts
==
1
){
# Only testname given, ex: alias
return
(
undef
,
$parts
[
0
],
undef
);
}
elsif
(
@parts
==
2
)
{
# Either testname.test or suite.testname given
# Ex. main.alias or alias.test
if
(
defined
$exts
{
$parts
[
1
]})
{
return
(
undef
,
$parts
[
0
],
$parts
[
1
]);
}
else
{
return
(
$parts
[
0
],
$parts
[
1
],
undef
);
}
}
elsif
(
@parts
==
3
)
{
# Fully specified suitename.testname.test
# ex main.alias.test
return
(
$parts
[
0
],
$parts
[
1
],
$parts
[
2
]);
}
mtr_error
("
Illegal format of test name:
$test_name
");
}
sub
collect_one_suite
($$)
sub
collect_one_suite
($$)
{
{
my
$suite
=
shift
;
# Test suite name
my
$suite
=
shift
;
# Test suite name
...
@@ -189,77 +229,55 @@ sub collect_one_suite($$)
...
@@ -189,77 +229,55 @@ sub collect_one_suite($$)
if
(
@::opt_cases
)
if
(
@::opt_cases
)
{
{
# Collect in specified order
, no sort
# Collect in specified order
foreach
my
$t
name2
(
@::opt_cases
)
foreach
my
$t
est_name_spec
(
@::opt_cases
)
{
{
my
$tname
=
$tname2
;
# Don't modify @::opt_cases !
my
(
$sname
,
$tname
,
$extension
)
=
split_testname
(
$test_name_spec
);
my
$elem
=
undef
;
my
$component_id
=
undef
;
# Get rid of directory part (path). Leave the extension since it is used
# to understand type of the test.
$tname
=
basename
(
$tname
);
# Get rid of suite part
# The test name parts have now been defined
$tname
=~
s/^(.*)\.//
;
#print " suite_name: $sname\n";
#print " tname: $tname\n";
#print " extension: $extension\n";
# Check if the extenstion has been specified.
# Check cirrect suite if suitename is defined
next
if
(
defined
$sname
and
$suite
ne
$sname
);
if
(
mtr_match_extension
(
$tname
,
"
test
")
)
my
$component_id
;
{
if
(
defined
$extension
)
$elem
=
$tname
;
$tname
=~
s/\.test$//
;
$component_id
=
'
mysqld
';
}
elsif
(
mtr_match_extension
(
$tname
,
"
imtest
")
)
{
{
$elem
=
$tname
;
my
$full_name
=
"
$testdir
/
$tname
.
$extension
";
$tname
=~
s/\.imtest$//
;
# Extension was specified, check if the test exists
$component_id
=
'
im
';
if
(
!
-
f
$full_name
)
}
# If target component is known, check that the specified test case
# exists.
#
# Otherwise, try to guess the target component.
if
(
$component_id
)
{
if
(
!
-
f
"
$testdir
/
$elem
")
{
{
mtr_error
("
Test case
$tname
(
$testdir
/
$elem
) is not found
");
# This is only an error if suite was specified, otherwise it
# could exist in another suite
mtr_error
("
Test '
$full_name
' was not found in suite '
$sname
'
")
if
$sname
;
next
;
}
}
$component_id
=
$exts
{
$extension
};
}
}
else
else
{
{
my
$mysqld_test_exists
=
-
f
"
$testdir
/
$tname
.test
";
# No extension was specified
my
$im_test_exists
=
-
f
"
$testdir
/
$tname
.imtest
";
my
(
$ext
,
$component
);
while
((
$ext
,
$component
)
=
each
%
exts
)
{
my
$full_name
=
"
$testdir
/
$tname
.
$ext
";
if
(
$mysqld_test_exists
and
$im_test_exists
)
if
(
!
-
f
$full_name
)
{
{
next
;
mtr_error
("
Ambiguous test case name (
$tname
)
");
}
}
$component_id
=
$component
;
elsif
(
!
$mysqld_test_exists
and
!
$im_test_exists
)
$extension
=
$ext
;
{
}
# Silently skip, could exist in another suite
# Test not found here, could exist in other suite
next
;
next
unless
$component_id
;
}
elsif
(
$mysqld_test_exists
)
{
$elem
=
"
$tname
.test
";
$component_id
=
'
mysqld
';
}
elsif
(
$im_test_exists
)
{
$elem
=
"
$tname
.imtest
";
$component_id
=
'
im
';
}
}
}
collect_one_test_case
(
$testdir
,
$resdir
,
$suite
,
$tname
,
collect_one_test_case
(
$testdir
,
$resdir
,
$suite
,
$tname
,
$elem
,
$cases
,
\%
disabled
,
$component_i
d
,
"
$tname
.
$extension
",
$cases
,
\%
disable
d
,
$suite_opts
);
$
component_id
,
$
suite_opts
);
}
}
}
}
else
else
...
@@ -319,6 +337,8 @@ sub collect_one_test_case($$$$$$$$$) {
...
@@ -319,6 +337,8 @@ sub collect_one_test_case($$$$$$$$$) {
my
$path
=
"
$testdir
/
$elem
";
my
$path
=
"
$testdir
/
$elem
";
print
"
collect_one_test_case
\n
";
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
# Skip some tests silently
# Skip some tests silently
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
...
...
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