summaryrefslogtreecommitdiff
path: root/mysql-test/lib
diff options
context:
space:
mode:
authorBjorn Munch <bjorn.munch@oracle.com>2010-11-09 13:04:44 +0100
committerBjorn Munch <bjorn.munch@oracle.com>2010-11-09 13:04:44 +0100
commit22830296ee509122b3797b2dee99c17b3e474a3b (patch)
tree185e047f3315439c6dfedacff6482e6752380100 /mysql-test/lib
parent0bb4f5fbb1d3523fbb6e51e2650e4c8dab02bc4c (diff)
parente0678e2ca624395a447dd8898583c13e31ec2f6a (diff)
downloadmariadb-git-22830296ee509122b3797b2dee99c17b3e474a3b.tar.gz
merge from 5.5-mtr
Diffstat (limited to 'mysql-test/lib')
-rw-r--r--mysql-test/lib/mtr_cases.pm21
1 files changed, 13 insertions, 8 deletions
diff --git a/mysql-test/lib/mtr_cases.pm b/mysql-test/lib/mtr_cases.pm
index 87f96496c73..a7d7a8aefa4 100644
--- a/mysql-test/lib/mtr_cases.pm
+++ b/mysql-test/lib/mtr_cases.pm
@@ -177,8 +177,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.
@@ -190,24 +188,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){