Patchwork [6,of,7] run-tests: report a test as warned when only missing globs

login
register
mail settings
Submitter Simon Heimberg
Date Feb. 13, 2014, 10:37 p.m.
Message ID <13e3899cf9a242d61348.1392331020@lapsasi>
Download mbox | patch
Permalink /patch/3649/
State Accepted
Commit 8ac08939c3fcb605738d266d03cc5a94aa2145d6
Headers show

Comments

Simon Heimberg - Feb. 13, 2014, 10:37 p.m.
# HG changeset patch
# User Simon Heimberg <simohe@besonet.ch>
# Date 1392276473 -3600
#      Thu Feb 13 08:27:53 2014 +0100
# Node ID 13e3899cf9a242d61348c23001ab0d4f2801965a
# Parent  92f9965a571a7134e37e7043a45cecd1646f04c8
run-tests: report a test as warned when only missing globs

On windows, some test reported as failed will now be reported as "warned".

Patch

diff -r 92f9965a571a -r 13e3899cf9a2 tests/run-tests.py
--- a/tests/run-tests.py	Thu Feb 13 08:26:13 2014 +0100
+++ b/tests/run-tests.py	Thu Feb 13 08:27:53 2014 +0100
@@ -776,6 +776,7 @@ 
 
     # Merge the script output back into a unified test
 
+    warnonly = True
     pos = -1
     postout = []
     for l in output:
@@ -796,7 +797,7 @@ 
             if isinstance(r, str):
                 if r == '+glob':
                     lout = el[:-1] + ' (glob)\n'
-                    r = False
+                    r = 0 # warn only
                 elif r == '-glob':
                     log('\ninfo, unnecessary glob in %s (after line %d):'
                         ' %s (glob)\n' % (test, pos, el[:-1]))
@@ -810,6 +811,8 @@ 
                 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 lcmd:
             # add on last return code
@@ -824,6 +827,8 @@ 
     if pos in after:
         postout += after.pop(pos)
 
+    if warnonly and exitcode == 0:
+        exitcode = False
     return exitcode, postout
 
 wifexited = getattr(os, "WIFEXITED", lambda x: False)