From 32e5304bff0effeef3354ebf6fd25fe0eb4ae124 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sat, 28 Mar 2015 18:05:53 +0100 Subject: [PATCH] mtr: fix testname,combination syntax to work in many-combination case in particular, "innodb.innodb-page_encryption,xtradb" should select these three tests: innodb.innodb-page_encryption 'cbc,xtradb' [ pass ] 35563 innodb.innodb-page_encryption 'ctr,xtradb' [ pass ] 36858 innodb.innodb-page_encryption 'ecb,xtradb' [ pass ] 36741 and deselect all innodb_plugin tests. This was not the case, because the %test_combs hash was destructively modified in the loop --- mysql-test/lib/mtr_cases.pm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/mysql-test/lib/mtr_cases.pm b/mysql-test/lib/mtr_cases.pm index 97348cd39fc..60535a2009b 100644 --- a/mysql-test/lib/mtr_cases.pm +++ b/mysql-test/lib/mtr_cases.pm @@ -618,7 +618,7 @@ 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}}; + $test_combs->{$comb->{name}} = 2; # Add combination name short name push @{$test->{combinations}}, $comb->{name}; @@ -627,8 +627,9 @@ sub make_combinations($$@) } # Skip all other combinations, if this combination is forced - if (delete $test_combs->{$comb->{name}}) { + if ($test_combs->{$comb->{name}}) { @combinations = ($comb); # run the loop below only for this combination + $test_combs->{$comb->{name}} = 2; last; } } @@ -858,9 +859,10 @@ sub collect_one_test_case { { @cases = map make_combinations($_, \%test_combs, @{$comb}), @cases; } - if (keys %test_combs) { + my @no_combs = grep { $test_combs{$_} == 1 } keys %test_combs; + if (@no_combs) { mtr_error("Could not run $name with '".( - join(',', sort keys %test_combs))."' combination(s)"); + join(',', sort @no_combs))."' combination(s)"); } for $tinfo (@cases) {