mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
merge from 5.1-mtr
This commit is contained in:
@ -170,8 +170,6 @@ sub collect_test_cases ($$$) {
|
||||
if ( $opt_reorder && !$quick_collect)
|
||||
{
|
||||
# Reorder the test cases in an order that will make them faster to run
|
||||
my %sort_criteria;
|
||||
|
||||
# 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
|
||||
# first, then a sub-criterion, then sub-sub-criterion, etc.
|
||||
@ -183,24 +181,31 @@ sub collect_test_cases ($$$) {
|
||||
# Append the criteria for sorting, in order of importance.
|
||||
#
|
||||
push(@criteria, "ndb=" . ($tinfo->{'ndb_test'} ? "A" : "B"));
|
||||
push(@criteria, $tinfo->{template_path});
|
||||
# Group test with equal options together.
|
||||
# Ending with "~" makes empty sort later than filled
|
||||
my $opts= $tinfo->{'master_opt'} ? $tinfo->{'master_opt'} : [];
|
||||
push(@criteria, join("!", sort @{$opts}) . "~");
|
||||
# Add slave opts if any
|
||||
if ($tinfo->{'slave_opt'})
|
||||
{
|
||||
push(@criteria, join("!", sort @{$tinfo->{'slave_opt'}}));
|
||||
}
|
||||
# This sorts tests with force-restart *before* identical tests
|
||||
push(@criteria, $tinfo->{force_restart} ? "force-restart" : "no-restart");
|
||||
|
||||
$sort_criteria{$tinfo->{name}} = join(" ", @criteria);
|
||||
$tinfo->{criteria}= join(" ", @criteria);
|
||||
}
|
||||
|
||||
@$cases = sort {
|
||||
$sort_criteria{$a->{'name'}} . $a->{'name'} cmp
|
||||
$sort_criteria{$b->{'name'}} . $b->{'name'}; } @$cases;
|
||||
@$cases = sort {$a->{criteria} cmp $b->{criteria}; } @$cases;
|
||||
|
||||
# For debugging the sort-order
|
||||
# foreach my $tinfo (@$cases)
|
||||
# {
|
||||
# print("$sort_criteria{$tinfo->{'name'}} -> \t$tinfo->{'name'}\n");
|
||||
# my $tname= $tinfo->{name} . ' ' . $tinfo->{combination};
|
||||
# my $crit= $tinfo->{criteria};
|
||||
# print("$tname\n\t$crit\n");
|
||||
# }
|
||||
|
||||
}
|
||||
|
||||
if (defined $print_testcases){
|
||||
|
Reference in New Issue
Block a user