From: Heiko Schlittermann (HS12-RIPE) Date: Sat, 27 Mar 2021 11:52:18 +0000 (+0100) Subject: testsuite: make runtest exit(!0) on failure in continue mode X-Git-Url: https://git.exim.org/users/heiko/exim.git/commitdiff_plain/87193ab87011f7c61fd9164e2a09913a55944340?hp=eb4c9690438d90c1cdec65fb194a39eb7b7cf371 testsuite: make runtest exit(!0) on failure in continue mode This makes it possible to use `runtest -c ` for `git bisect run …` --- diff --git a/test/runtest b/test/runtest index fbefff5e6..0b236bca1 100755 --- a/test/runtest +++ b/test/runtest @@ -4149,6 +4149,7 @@ if (not $force_continue) { } +my $failures = 0; foreach $test (@test_list) { state $lasttestdir = ''; @@ -4382,10 +4383,12 @@ foreach $test (@test_list) print "\nshow stdErr, show stdOut, Retry, Continue (without file comparison), or Quit? [Q] "; $_ = $force_continue ? "c" : ; tests_exit(1) if /^q?$/i; - if (/^c$/ && $force_continue) { - log_failure($log_failed_filename, $testno, "exit code unexpected"); - log_test($log_summary_filename, $testno, 'F') - } + if (/^c$/ && $force_continue) + { + log_failure($log_failed_filename, $testno, "exit code unexpected"); + log_test($log_summary_filename, $testno, 'F'); + $failures++; + } if ($force_continue) { print "\nstdout tail:\n"; @@ -4449,10 +4452,12 @@ foreach $test (@test_list) print "\nShow server stdout, Retry, Continue, or Quit? [Q] "; $_ = $force_continue ? "c" : ; tests_exit(1) if /^q?$/i; - if (/^c$/ && $force_continue) { - log_failure($log_failed_filename, $testno, "exit code unexpected"); - log_test($log_summary_filename, $testno, 'F') - } + if (/^c$/ && $force_continue) + { + log_failure($log_failed_filename, $testno, "exit code unexpected"); + log_test($log_summary_filename, $testno, 'F'); + $failures++; + } print "... continue forced\n" if $force_continue; last if /^[rc]$/i; @@ -4487,7 +4492,14 @@ foreach $test (@test_list) { sleep 1 if $slow; my $rc = check_output($TEST_STATE->{munge}); - log_test($log_summary_filename, $testno, 'P') if ($rc == 0); + if ($rc == 0) + { + log_test($log_summary_filename, $testno, 'P'); + } + else + { + $failures++; + } if ($rc < 2) { print (" Script completed\n"); @@ -4506,7 +4518,7 @@ foreach $test (@test_list) ################################################## tests_exit(-1, "No runnable tests selected") if not @test_list; -tests_exit(0); +tests_exit($failures); __END__