diff options
Diffstat (limited to 'mysql-test/lib/mtr_report.pm')
-rw-r--r-- | mysql-test/lib/mtr_report.pm | 40 |
1 files changed, 35 insertions, 5 deletions
diff --git a/mysql-test/lib/mtr_report.pm b/mysql-test/lib/mtr_report.pm index 04a3aeeef7f..cdf77d5e1ce 100644 --- a/mysql-test/lib/mtr_report.pm +++ b/mysql-test/lib/mtr_report.pm @@ -69,6 +69,8 @@ sub _mtr_report_test_name ($) { print _name(), _timestamp(); printf "%-40s ", $tname; + + return $tname; } @@ -105,20 +107,48 @@ sub mtr_report_test_passed ($) { sub mtr_report_test ($) { my ($tinfo)= @_; - _mtr_report_test_name($tinfo); + my $test_name = _mtr_report_test_name($tinfo); my $comment= $tinfo->{'comment'}; my $logfile= $tinfo->{'logfile'}; my $warnings= $tinfo->{'warnings'}; my $result= $tinfo->{'result'}; + my $retry= $tinfo->{'retries'} ? "retry-" : ""; if ($result eq 'MTR_RES_FAILED'){ my $timest = format_time(); + my $fail = "fail"; + + if ( $::opt_experimental ) + { + # Find out if this test case is an experimental one, so we can treat + # the failure as an expected failure instead of a regression. + for my $exp ( @$::experimental_test_cases ) { + if ( $exp ne $test_name ) { + # if the expression is not the name of this test case, but has + # an asterisk at the end, determine if the characters up to + # but excluding the asterisk are the same + if ( $exp ne "" && substr($exp, -1, 1) eq "*" ) { + $exp = substr($exp, 0, length($exp) - 1); + if ( substr($test_name, 0, length($exp)) ne $exp ) { + # no match, try next entry + next; + } + # if yes, fall through to set the exp-fail status + } else { + # no match, try next entry + next; + } + } + $fail = "exp-fail"; + last; + } + } if ( $warnings ) { - mtr_report("[ fail ] Found warnings/errors in server log file!"); + mtr_report("[ $retry$fail ] Found warnings/errors in server log file!"); mtr_report(" Test ended at $timest"); mtr_report($warnings); return; @@ -126,14 +156,14 @@ sub mtr_report_test ($) { my $timeout= $tinfo->{'timeout'}; if ( $timeout ) { - mtr_report("[ fail ] timeout after $timeout seconds"); + mtr_report("[ $retry$fail ] timeout after $timeout seconds"); mtr_report(" Test ended at $timest"); mtr_report("\n$tinfo->{'comment'}"); return; } else { - mtr_report("[ fail ]\n Test ended at $timest"); + mtr_report("[ $retry$fail ]\n Test ended at $timest"); } if ( $logfile ) @@ -176,7 +206,7 @@ sub mtr_report_test ($) { { my $timer_str= $tinfo->{timer} || ""; $tot_real_time += ($timer_str/1000); - mtr_report("[ pass ] ", sprintf("%5s", $timer_str)); + mtr_report("[ ${retry}pass ] ", sprintf("%5s", $timer_str)); # Show any problems check-testcase found if ( defined $tinfo->{'check'} ) |