[exim-cvs] testsuite: make runtest exit(!0) on failure in co…

Páxina inicial
Borrar esta mensaxe
Responder a esta mensaxe
Autor: Exim Git Commits Mailing List
Data:  
Para: exim-cvs
Asunto: [exim-cvs] testsuite: make runtest exit(!0) on failure in continue mode
Gitweb: https://git.exim.org/exim.git/commitdiff/87193ab87011f7c61fd9164e2a09913a55944340
Commit:     87193ab87011f7c61fd9164e2a09913a55944340
Parent:     eb4c9690438d90c1cdec65fb194a39eb7b7cf371
Author:     Heiko Schlittermann (HS12-RIPE) <hs@???>
AuthorDate: Sat Mar 27 12:52:18 2021 +0100
Committer:  Heiko Schlittermann (HS12-RIPE) <hs@???>
CommitDate: Sat Mar 27 23:33:17 2021 +0100


    testsuite: make runtest exit(!0) on failure in continue mode


    This makes it possible to use `runtest -c <xx>` for `git bisect run …`
---
 test/runtest | 32 ++++++++++++++++++++++----------
 1 file changed, 22 insertions(+), 10 deletions(-)


diff --git a/test/runtest b/test/runtest
index fbefff5..0b236bc 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" : <T>;
         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" : <T>;
           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__