summaryrefslogtreecommitdiff
path: root/mysql-test/lib
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2013-09-21 10:14:42 +0200
committerSergei Golubchik <sergii@pisem.net>2013-09-21 10:14:42 +0200
commit9af177042ed0e297b8f26f2c2f8ae00b3a814a90 (patch)
tree0d8d2fab7ebeb02f3c25c00ac1543754b625bde8 /mysql-test/lib
parenta6add4ff43a905cee1bfd00b2ec2d276018866ce (diff)
parent2fe0836eed16ce5809c34064893681f12c77da9f (diff)
downloadmariadb-git-9af177042ed0e297b8f26f2c2f8ae00b3a814a90.tar.gz
10.0-base merge.
Partitioning/InnoDB changes are *not* merged (they'll come from 5.6) TokuDB does not compile (not updated to 10.0 SE API)
Diffstat (limited to 'mysql-test/lib')
-rw-r--r--mysql-test/lib/mtr_cases.pm37
1 files changed, 27 insertions, 10 deletions
diff --git a/mysql-test/lib/mtr_cases.pm b/mysql-test/lib/mtr_cases.pm
index a82e3ee10b7..1327afdb426 100644
--- a/mysql-test/lib/mtr_cases.pm
+++ b/mysql-test/lib/mtr_cases.pm
@@ -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 was found
+ # Check that the tests specified were 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) {