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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
46b3997c
Commit
46b3997c
authored
Sep 01, 2006
by
cmiller@maint1.mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mtr_cases.pl:
Provide a more extensible, easier-to-change way of reordering test cases.
parent
53bb6a47
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
27 deletions
+31
-27
mysql-test/lib/mtr_cases.pl
mysql-test/lib/mtr_cases.pl
+31
-27
No files found.
mysql-test/lib/mtr_cases.pl
View file @
46b3997c
...
@@ -82,7 +82,7 @@ sub collect_test_cases ($) {
...
@@ -82,7 +82,7 @@ sub collect_test_cases ($) {
if
(
$mysqld_test_exists
and
$im_test_exists
)
if
(
$mysqld_test_exists
and
$im_test_exists
)
{
{
mtr_error
("
Ambiguos test case name (
$tname
)
");
mtr_error
("
Ambiguo
u
s test case name (
$tname
)
");
}
}
elsif
(
!
$mysqld_test_exists
and
!
$im_test_exists
)
elsif
(
!
$mysqld_test_exists
and
!
$im_test_exists
)
{
{
...
@@ -154,34 +154,38 @@ sub collect_test_cases ($) {
...
@@ -154,34 +154,38 @@ sub collect_test_cases ($) {
if
(
$::opt_reorder
)
if
(
$::opt_reorder
)
{
{
@$cases
=
sort
{
if
(
!
$a
->
{'
master_restart
'}
and
!
$b
->
{'
master_restart
'}
)
{
return
$a
->
{'
name
'}
cmp
$b
->
{'
name
'};
}
if
(
$a
->
{'
master_restart
'}
and
$b
->
{'
master_restart
'}
)
my
%
sort_criteria
;
{
my
$tinfo
;
my
$cmp
=
mtr_cmp_opts
(
$a
->
{'
master_opt
'},
$b
->
{'
master_opt
'});
if
(
$cmp
==
0
)
{
return
$a
->
{'
name
'}
cmp
$b
->
{'
name
'};
}
else
{
return
$cmp
;
}
}
if
(
$a
->
{'
master_restart
'}
)
# Make a mapping of test name to a string that represents how that test
{
# should be sorted among the other tests. Put the most important criterion
return
1
;
# Is greater
# first, then a sub-criterion, then sub-sub-criterion, et c.
}
foreach
$tinfo
(
@$cases
)
else
{
{
my
@this_criteria
=
();
return
-
1
;
# Is less
}
# Append the criteria for sorting, in order of importance.
}
@$cases
;
push
(
@this_criteria
,
join
("
!
",
sort
@
{
$tinfo
->
{'
master_opt
'}})
.
"
~
");
# Ending with "~" makes empty sort later than filled
push
(
@this_criteria
,
"
ndb=
"
.
(
$tinfo
->
{'
ndb_test
'}
?
"
1
"
:
"
0
"));
push
(
@this_criteria
,
"
restart=
"
.
(
$tinfo
->
{'
master_restart
'}
?
"
1
"
:
"
0
"));
push
(
@this_criteria
,
"
big_test=
"
.
(
$tinfo
->
{'
big_test
'}
?
"
1
"
:
"
0
"));
push
(
@this_criteria
,
join
("
|
",
sort
keys
%
{
$tinfo
}));
# Group similar things together. The values may differ substantially. FIXME?
push
(
@this_criteria
,
$tinfo
->
{'
name
'});
# Finally, order by the name
$sort_criteria
{
$tinfo
->
{"
name
"}}
=
join
("
",
@this_criteria
);
}
@$cases
=
sort
{
$sort_criteria
{
$a
->
{"
name
"}}
cmp
$sort_criteria
{
$b
->
{"
name
"}};
}
@$cases
;
### For debugging the sort-order
# foreach $tinfo (@$cases)
# {
# print $sort_criteria{$tinfo->{"name"}};
# print " -> \t";
# print $tinfo->{"name"};
# print "\n";
# }
}
}
return
$cases
;
return
$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