diff options
author | Sergei Golubchik <sergii@pisem.net> | 2012-02-06 22:55:17 +0100 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2012-02-06 22:55:17 +0100 |
commit | 3320a4bffb715c7596d9daded90ff1b37e8229f2 (patch) | |
tree | a74551f96ba7a87ddf6db83fc6490b54303c9a36 /mysql-test/lib | |
parent | 9c8c572fd327385b6c3801fbd8d1a9419484b0f4 (diff) | |
download | mariadb-git-3320a4bffb715c7596d9daded90ff1b37e8229f2.tar.gz |
per-combination result files
Diffstat (limited to 'mysql-test/lib')
-rw-r--r-- | mysql-test/lib/mtr_cases.pm | 44 |
1 files changed, 30 insertions, 14 deletions
diff --git a/mysql-test/lib/mtr_cases.pm b/mysql-test/lib/mtr_cases.pm index 758d87303a8..cd90f4bea43 100644 --- a/mysql-test/lib/mtr_cases.pm +++ b/mysql-test/lib/mtr_cases.pm @@ -616,20 +616,6 @@ sub collect_one_test_case { suite => $suites{$suitename}, ); - my $result_file= "$resdir/$tname.result"; - if (-f $result_file) { - # Allow nonexistsing result file - # in that case .test must issue "exit" otherwise test - # should fail by default - $tinfo->{result_file}= $result_file; - } - else { - # No .result file exist - # Remember the path where it should be - # saved in case of --record - $tinfo->{record_file}= $result_file; - } - # ---------------------------------------------------------------------- # Skip some tests but include in list, just mark them as skipped # ---------------------------------------------------------------------- @@ -871,6 +857,36 @@ sub collect_one_test_case { { @cases = map make_combinations($_, @{$comb}), @cases; } + + for $tinfo (@cases) { + if ($tinfo->{combinations}) { + my $re = '(?:' . join('|', @{$tinfo->{combinations}}) . ')'; + my $found = 0; + for (<$resdir/$tname,*.result>) { + m|$tname((?:,$re)+)\.result$| or next; + my $combs = $&; + my @commas = ($combs =~ m/,/g); + # prefer the most specific result file + if (@commas > $found) { + $found = @commas; + $tinfo->{result_file} = $_; + } + } + } + + unless (defined $tinfo->{result_file}) { + my $result_file= "$resdir/$tname.result"; + if (-f $result_file) { + $tinfo->{result_file}= $result_file; + } else { + # No .result file exist + # Remember the path where it should be + # saved in case of --record + $tinfo->{record_file}= $result_file; + } + } + } + return @cases; } |