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
6ee207a5
Commit
6ee207a5
authored
Sep 11, 2013
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
support ./mtr suite.test,com,bi,na,tions syntax
parent
62643f81
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
10 deletions
+27
-10
mysql-test/lib/mtr_cases.pm
mysql-test/lib/mtr_cases.pm
+27
-10
No files found.
mysql-test/lib/mtr_cases.pm
View file @
6ee207a5
...
...
@@ -117,7 +117,7 @@ sub collect_test_cases ($$$$) {
if
(
@$opt_cases
)
{
# A list of tests was specified on the command line
# Check that the tests specified w
as
found
# Check that the tests specified w
ere
found
# in at least one suite
foreach
my
$test_name_spec
(
@$opt_cases
)
{
...
...
@@ -189,30 +189,33 @@ sub collect_test_cases ($$$$) {
}
# Returns (suitename, testname)
# Returns (suitename, testname
, combinations....
)
sub
split_testname
{
my
(
$test_name
)
=
@_
;
# If .test file name is used, get rid of directory part
$test_name
=
basename
(
$test_name
)
if
$test_name
=~
/\.test$/
;
# Then, get the combinations:
my
(
$test_name
,
@combs
)
=
split
/,/
,
$test_name
;
# Now split name on .'s
my
@parts
=
split
(
/\./
,
$test_name
);
if
(
@parts
==
1
){
# Only testname given, ex: alias
return
(
undef
,
$parts
[
0
]);
return
(
undef
,
$parts
[
0
]
,
@combs
);
}
elsif
(
@parts
==
2
)
{
# Either testname.test or suite.testname given
# Ex. main.alias or alias.test
if
(
$parts
[
1
]
eq
"
test
")
{
return
(
undef
,
$parts
[
0
]);
return
(
undef
,
$parts
[
0
]
,
@combs
);
}
else
{
return
(
$parts
[
0
],
$parts
[
1
]);
return
(
$parts
[
0
],
$parts
[
1
]
,
@combs
);
}
}
...
...
@@ -499,14 +502,14 @@ sub process_suite {
# Collect in specified order
foreach
my
$test_name_spec
(
@$opt_cases
)
{
my
(
$sname
,
$tname
)
=
split_testname
(
$test_name_spec
);
my
(
$sname
,
$tname
,
@combs
)
=
split_testname
(
$test_name_spec
);
# Check correct suite if suitename is defined
next
if
defined
$sname
and
$sname
ne
$suitename
and
$sname
ne
"
$basename
-
";
next
unless
$all_cases
{
$tname
};
push
@cases
,
collect_one_test_case
(
$suite
,
$all_cases
{
$tname
},
$tname
);
push
@cases
,
collect_one_test_case
(
$suite
,
$all_cases
{
$tname
},
$tname
,
@combs
);
}
}
else
{
for
(
sort
keys
%
all_cases
)
...
...
@@ -559,9 +562,9 @@ sub process_opts {
}
}
sub
make_combinations
($@)
sub
make_combinations
($
$
@)
{
my
(
$test
,
@combinations
)
=
@_
;
my
(
$test
,
$test_combs
,
@combinations
)
=
@_
;
return
(
$test
)
if
$test
->
{'
skip
'}
or
not
@combinations
;
if
(
$combinations
[
0
]
->
{
skip
})
{
...
...
@@ -578,11 +581,19 @@ sub make_combinations($@)
if
(
My::Options::
is_set
(
$test
->
{
master_opt
},
$comb
->
{
comb_opt
})
&&
My::Options::
is_set
(
$test
->
{
slave_opt
},
$comb
->
{
comb_opt
})
){
delete
$test_combs
->
{
$comb
->
{
name
}};
# Add combination name short name
push
@
{
$test
->
{
combinations
}},
$comb
->
{
name
};
return
(
$test
);
}
# Skip all other combinations, if this combination is forced
if
(
delete
$test_combs
->
{
$comb
->
{
name
}})
{
@combinations
=
(
$comb
);
# run the loop below only for this combination
last
;
}
}
my
@cases
;
...
...
@@ -635,6 +646,8 @@ sub collect_one_test_case {
my
$suite
=
shift
;
my
$tpath
=
shift
;
my
$tname
=
shift
;
my
%
test_combs
=
map
{
$_
=>
1
}
@_
;
my
$suitename
=
$suite
->
{
name
};
my
$name
=
"
$suitename
.
$tname
";
...
...
@@ -829,7 +842,11 @@ sub collect_one_test_case {
my
@cases
=
(
$tinfo
);
for
my
$comb
(
$suite
->
{
combinations
},
@
{
$file_combinations
{
$filename
}})
{
@cases
=
map
make_combinations
(
$_
,
@
{
$comb
}),
@cases
;
@cases
=
map
make_combinations
(
$_
,
\%
test_combs
,
@
{
$comb
}),
@cases
;
}
if
(
keys
%
test_combs
)
{
mtr_error
("
Could not run
$name
with '
"
.
(
join
('
,
',
sort
keys
%
test_combs
))
.
"
' combination(s)
");
}
for
$tinfo
(
@cases
)
{
...
...
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