run-tests: fixed warn detection on detecting warn only for lines stable
authorSimon Heimberg <simohe@besonet.ch>
Sun, 16 Feb 2014 23:36:02 +0100
branchstable
changeset 1347 0ec1025011f4
parent 1346 95c0dc05372a
child 1348 2cb27f4b641c
run-tests: fixed warn detection on detecting warn only for lines The state "warned" was reported too often. The main problem was that "False == 0" is true in python. Therefore use an empty string instead of 0 for reporting warn only for a line. The other problem is fixed in the next patch. [ original upstream message ]
tests/run-tests.py
--- a/tests/run-tests.py	Sun Mar 02 13:51:01 2014 +0000
+++ b/tests/run-tests.py	Sun Feb 16 23:36:02 2014 +0100
@@ -797,10 +797,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,7 +810,7 @@
                 if needescape(lout):
                     lout = stringescape(lout.rstrip('\n')) + " (esc)\n"
                 postout.append("  " + lout) # let diff deal with it
-                if r != 0: # != warn only
+                if r != '': # if line failed
                     warnonly = False
 
         if lcmd: