Merge with stable
authorChristian Ebert <blacktrash@gmx.net>
Sun, 02 Mar 2014 13:53:07 +0000
changeset 1349 42b428c5fcd8
parent 1345 ea8abd9436ee (current diff)
parent 1348 2cb27f4b641c (diff)
child 1352 9dcd045229b4
Merge with stable
--- a/tests/run-tests.py	Tue Feb 25 11:11:46 2014 +0000
+++ b/tests/run-tests.py	Sun Mar 02 13:53:07 2014 +0000
@@ -776,7 +776,9 @@
 
     # Merge the script output back into a unified test
 
-    warnonly = True
+    warnonly = 1 # 1: not yet, 2: yes, 3: for sure not
+    if exitcode != 0: # failure has been reported
+        warnonly = 3 # set to "for sure not"
     pos = -1
     postout = []
     for l in output:
@@ -797,10 +799,10 @@
             if isinstance(r, str):
                 if r == '+glob':
                     lout = el[:-1] + ' (glob)\n'
-                    r = 0 # warn only
+                    r = '' # warn only this line
                 elif r == '-glob':
                     lout = ''.join(el.rsplit(' (glob)', 1))
-                    r = 0 # warn only
+                    r = '' # warn only this line
                 else:
                     log('\ninfo, unknown linematch result: %r\n' % r)
                     r = False
@@ -810,8 +812,10 @@
                 if needescape(lout):
                     lout = stringescape(lout.rstrip('\n')) + " (esc)\n"
                 postout.append("  " + lout) # let diff deal with it
-                if r != 0: # != warn only
-                    warnonly = False
+                if r != '': # if line failed
+                    warnonly = 3 # set to "for sure not"
+                elif warnonly == 1: # is "not yet" (and line is warn only)
+                    warnonly = 2 # set to "yes" do warn
 
         if lcmd:
             # add on last return code
@@ -826,8 +830,8 @@
     if pos in after:
         postout += after.pop(pos)
 
-    if warnonly and exitcode == 0:
-        exitcode = False
+    if warnonly == 2:
+        exitcode = False # set exitcode to warned
     return exitcode, postout
 
 wifexited = getattr(os, "WIFEXITED", lambda x: False)