Commit ad365a5c authored by Bjorn Munch's avatar Bjorn Munch

Bug #45190 mtr should report some statistics even if aborting after too many tests fail

Added calls to mtr_report_stats() also after timeout or too many failures
parent 709cd009
...@@ -221,8 +221,8 @@ sub mtr_report_test ($) { ...@@ -221,8 +221,8 @@ sub mtr_report_test ($) {
} }
sub mtr_report_stats ($) { sub mtr_report_stats ($;$) {
my $tests= shift; my ($tests, $dont_error)= @_;
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# Find out how we where doing # Find out how we where doing
...@@ -374,7 +374,7 @@ sub mtr_report_stats ($) { ...@@ -374,7 +374,7 @@ sub mtr_report_stats ($) {
if ( $tot_failed != 0 || $found_problems) if ( $tot_failed != 0 || $found_problems)
{ {
mtr_error("there were failing test cases"); mtr_error("there were failing test cases") unless $dont_error;
} }
} }
......
...@@ -528,6 +528,8 @@ sub run_test_server ($$$) { ...@@ -528,6 +528,8 @@ sub run_test_server ($$$) {
elsif ($opt_max_test_fail > 0 and elsif ($opt_max_test_fail > 0 and
$num_failed_test >= $opt_max_test_fail) { $num_failed_test >= $opt_max_test_fail) {
$suite_timeout_proc->kill(); $suite_timeout_proc->kill();
push(@$completed, $result);
mtr_report_stats($completed, 1);
mtr_report("Too many tests($num_failed_test) failed!", mtr_report("Too many tests($num_failed_test) failed!",
"Terminating..."); "Terminating...");
return undef; return undef;
...@@ -659,6 +661,7 @@ sub run_test_server ($$$) { ...@@ -659,6 +661,7 @@ sub run_test_server ($$$) {
# ---------------------------------------------------- # ----------------------------------------------------
if ( ! $suite_timeout_proc->wait_one(0) ) if ( ! $suite_timeout_proc->wait_one(0) )
{ {
mtr_report_stats($completed, 1);
mtr_report("Test suite timeout! Terminating..."); mtr_report("Test suite timeout! Terminating...");
return undef; return undef;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment