summaryrefslogtreecommitdiff
path: root/mysql-test/lib/mtr_cases.pm
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/lib/mtr_cases.pm')
-rw-r--r--mysql-test/lib/mtr_cases.pm42
1 files changed, 29 insertions, 13 deletions
diff --git a/mysql-test/lib/mtr_cases.pm b/mysql-test/lib/mtr_cases.pm
index f11c76a0727..5f557ef5d99 100644
--- a/mysql-test/lib/mtr_cases.pm
+++ b/mysql-test/lib/mtr_cases.pm
@@ -1,6 +1,6 @@
# -*- cperl -*-
-# Copyright (C) 2005-2006 MySQL AB
-#
+# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
@@ -91,15 +91,16 @@ sub init_pattern {
sub testcase_sort_order {
my ($a, $b, $sort_criteria)= @_;
- my $a_sort_criteria= $sort_criteria->{$a->fullname()};
- my $b_sort_criteria= $sort_criteria->{$b->fullname()};
- my $res= $a_sort_criteria cmp $b_sort_criteria;
- return $res if $res;
# Run slow tests first, trying to avoid getting stuck at the end
# with a slow test in one worker and the other workers idle.
return -1 if $a->{'long_test'} && !$b->{'long_test'};
return 1 if !$a->{'long_test'} && $b->{'long_test'};
+ my $a_sort_criteria= $sort_criteria->{$a->fullname()};
+ my $b_sort_criteria= $sort_criteria->{$b->fullname()};
+ my $res= $a_sort_criteria cmp $b_sort_criteria;
+ return $res if $res;
+
return $a->fullname() cmp $b->fullname();
}
@@ -143,7 +144,7 @@ sub collect_test_cases ($$$) {
{
last unless $opt_reorder;
# test->{name} is always in suite.name format
- if ( $test->{name} =~ /.*\.$tname/ )
+ if ( $test->{name} =~ /^$sname.*\.$tname$/ )
{
$found= 1;
last;
@@ -183,12 +184,21 @@ 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->fullname()} = join(" ", @criteria);
+ $tinfo->{criteria}= join(" ", @criteria);
+ $sort_criteria{$tinfo->fullname()} = $tinfo->{criteria};
}
@$cases = sort { testcase_sort_order($a, $b, \%sort_criteria) } @$cases;
@@ -196,9 +206,10 @@ sub collect_test_cases ($$$) {
# For debugging the sort-order
# foreach my $tinfo (@$cases)
# {
- # print $sort_criteria{$tinfo->fullname()}," -> \t",$tinfo->fullname(),"\n";
+ # my $tname= $tinfo->{name} . ' ' . $tinfo->{combination};
+ # my $crit= $tinfo->{criteria};
+ # print("$tname\n\t$crit\n");
# }
-
}
if (defined $print_testcases){
@@ -902,9 +913,14 @@ sub collect_one_test_case {
if ( $tinfo->{'big_test'} and ! $::opt_big_test )
{
$tinfo->{'skip'}= 1;
- $tinfo->{'comment'}= "Test needs 'big-test' option";
+ $tinfo->{'comment'}= "Test needs --big-test";
return $tinfo
}
+ if ( $tinfo->{'big_test'} )
+ {
+ # All 'big_test' takes a long time to run
+ $tinfo->{'long_test'}= 1;
+ }
if ( $tinfo->{'need_debug'} && ! $::debug_compiled_binaries )
{
@@ -927,7 +943,7 @@ sub collect_one_test_case {
{
# All ndb test's should be skipped
$tinfo->{'skip'}= 1;
- $tinfo->{'comment'}= "No ndbcluster tests(--skip-ndbcluster)";
+ $tinfo->{'comment'}= "No ndbcluster";
return $tinfo;
}
}
@@ -948,7 +964,7 @@ sub collect_one_test_case {
if ( $skip_rpl )
{
$tinfo->{'skip'}= 1;
- $tinfo->{'comment'}= "No replication tests(--skip-rpl)";
+ $tinfo->{'comment'}= "No replication tests";
return $tinfo;
}
}