changeset 2:f77e7e92cc95

recognize test status
author John W. Eaton <jwe@octave.org>
date Wed, 13 Jun 2018 16:27:52 +0000
parents 97e7b7963dc9
children 7a07ae3068be
files master.cfg
diffstat 1 files changed, 19 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/master.cfg	Tue Jun 12 21:14:47 2018 +0000
+++ b/master.cfg	Wed Jun 13 16:27:52 2018 +0000
@@ -272,24 +272,36 @@
       self.warningPattern = None
     self.rc = SUCCESS
     self.total = 0
+    self.passed = 0
     self.failed = 0
     self.warnings = 0
+    self.summary_found = False
     self.complete = False
 
-  testsRe = re.compile (r"^  (PASS|FAIL|REGRESSION|XFAIL|SKIP).*(\d+)")
+  summaryRe = re.compile (r"^Summary: *$")
+  testsRe = re.compile (r"^ *(PASS|FAIL|REGRESSION|XFAIL|SKIP)[^\d]*(\d+)")
         
   def outLineReceived (self, line):
     if self.warningPattern.match (line):
       self.warnings += 1
+
+    if not self.summary_found:
+      mo = self.summaryRe.search (line)
+      if mo:
+        self.summary_found = True
+      return
+
     mo = self.testsRe.search (line)
     if mo:
-      type = mo.group(1)
-      count = int (mo.group(2))
+      typ = mo.group(1)
+      num = int (mo.group(2))
       self.total += num
-      if type == "FAIL" or type == "REGRESSION":
-        if count > 0:
+      if typ == "PASS":
+        self.passed += num
+      if typ == "FAIL" or typ == "REGRESSION":
+        if num > 0:
           self.rc = FAILURE
-        self.failed += count
+          self.failed += num
 
 
 class octave_test (Test):
@@ -305,7 +317,7 @@
 
       self.setTestResults (total = self.observer.total,
                            failed = self.observer.failed,
-                           passed = passed,
+                           passed = self.observer.passed,
                            warnings = self.observer.warnings)
 
     rc = self.observer.rc