From b9a810dd25550aa79978fcbfbbc5596b7366bb6c Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.mysql.com" <> Date: Sun, 4 May 2008 21:21:11 +0200 Subject: [PATCH] Correctly calculate failed tests --- mysql-test/lib/mtr_report.pm | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/mysql-test/lib/mtr_report.pm b/mysql-test/lib/mtr_report.pm index cf884b41d55..026d5e9776e 100644 --- a/mysql-test/lib/mtr_report.pm +++ b/mysql-test/lib/mtr_report.pm @@ -222,22 +222,27 @@ sub mtr_report_stats ($) { foreach my $tinfo (@$tests) { - if ( $tinfo->{'result'} eq 'MTR_RES_SKIPPED' ) + if ( $tinfo->{failures} ) { + # Test has failed at least one time + $tot_tests++; + $tot_failed++; + } + elsif ( $tinfo->{'result'} eq 'MTR_RES_SKIPPED' ) + { + # Test was skipped $tot_skiped++; } elsif ( $tinfo->{'result'} eq 'MTR_RES_PASSED' ) { + # Test passed $tot_tests++; $tot_passed++; } - elsif ( $tinfo->{failures} ) - { - $tot_tests++; - $tot_failed++; - } + if ( $tinfo->{'restarted'} ) { + # Servers was restarted $tot_restarts++; } @@ -302,7 +307,7 @@ sub mtr_report_stats ($) { # Print each failed test, again #foreach my $test ( @$tests ){ - # if ( $test->{result} eq 'MTR_RES_FAILED' ) { + # if ( $test->{failures} ) { # mtr_report_test($test); # } #} @@ -320,7 +325,7 @@ sub mtr_report_stats ($) { foreach my $tinfo (@$tests) { my $tname= $tinfo->{'name'}; - if ( $tinfo->{'result'} eq 'MTR_RES_FAILED' and ! $seen{$tname}) + if ( $tinfo->{failures} and ! $seen{$tname}) { print " $tname"; $seen{$tname}= 1;