From 3211bbb428a143237236ebbbf080466aa3936530 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Tue, 11 Oct 2022 10:48:32 +0200 Subject: [PATCH] Print the list of failed suites in verbose mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In verbose mode, the full output of each failing suite is printed out, which for some suites runs in the 1000s of lines. If you didn't redirect output to a file, this is a lot to scroll and can make it hard to quickly identify which test suites failed. So, let's print out that information at the end. This is useful information for starting to figure out what went wrong. Signed-off-by: Manuel Pégourié-Gonnard --- tests/scripts/run-test-suites.pl | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/tests/scripts/run-test-suites.pl b/tests/scripts/run-test-suites.pl index 15fa8bcf7a48..22eadd180543 100755 --- a/tests/scripts/run-test-suites.pl +++ b/tests/scripts/run-test-suites.pl @@ -74,7 +74,7 @@ =head1 SYNOPSIS my $prefix = $^O eq "MSWin32" ? '' : './'; -my ($failed_suites, $total_tests_run, $failed, $suite_cases_passed, +my (@failed_suites, $total_tests_run, $failed, $suite_cases_passed, $suite_cases_failed, $suite_cases_skipped, $total_cases_passed, $total_cases_failed, $total_cases_skipped ); my $suites_skipped = 0; @@ -112,7 +112,7 @@ sub pad_print_center { pad_print_center( 72, '-', "End $suite" ); } } else { - $failed_suites++; + push @failed_suites, $suite; print "FAIL\n"; if( $verbose ) { pad_print_center( 72, '-', "Begin $suite" ); @@ -139,12 +139,17 @@ sub pad_print_center { } print "-" x 72, "\n"; -print $failed_suites ? "FAILED" : "PASSED"; +print @failed_suites ? "FAILED" : "PASSED"; printf( " (%d suites, %d tests run%s)\n", scalar(@suites) - $suites_skipped, $total_tests_run, $suites_skipped ? ", $suites_skipped suites skipped" : "" ); +if( $verbose && @failed_suites ) { + # the output can be very long, so provide a summary of which suites failed + print " failed suites : @failed_suites\n"; +} + if( $verbose > 1 ) { print " test cases passed :", $total_cases_passed, "\n"; print " failed :", $total_cases_failed, "\n"; @@ -159,5 +164,5 @@ sub pad_print_center { } } -exit( $failed_suites ? 1 : 0 ); +exit( @failed_suites ? 1 : 0 );