Patchwork [2,of,4] tests: inform on Windows about unnecessary glob lines

login
register
mail settings
Submitter Simon Heimberg
Date Feb. 12, 2013, 11:05 p.m.
Message ID <282ccb8b49295d2fafb9.1360710331@lapsi.heimberg.home>
Download mbox | patch
Permalink /patch/968/
State Accepted
Commit 7591ed29e824d1701ef33abde07a704e72e9dd95
Headers show

Comments

Simon Heimberg - Feb. 12, 2013, 11:05 p.m.
# HG changeset patch
# User Simon Heimberg <simohe@besonet.ch>
# Date 1350336525 -7200
# Node ID 282ccb8b49295d2fafb987ca1d7a1e609c18f3fa
# Parent  87f4812f32220895202a185a92a7977bdee5f0a0
tests: inform on Windows about unnecessary glob lines

When glob lines directly match on windows, "/" (and not "\") was output in the
path on the line. No glob matching is necessary in this case.

The test output will look like this (when 5 tests have passed and no 4 has an
unnecessary glob):
...
Info, unnecessary glob: info about some/thing (glob)
..

Patch

diff -r 87f4812f3222 -r 282ccb8b4929 tests/run-tests.py
--- a/tests/run-tests.py	Mon Okt 15 23:02:19 2012 +0200
+++ b/tests/run-tests.py	Mon Okt 15 23:28:45 2012 +0200
@@ -542,6 +542,11 @@ 
     # The only supported special characters are * and ? plus / which also
     # matches \ on windows. Escaping of these caracters is supported.
     if el + '\n' == l:
+        if os.name == 'nt':
+            # matching on "/" is not needed for this line
+            iolock.acquire()
+            print "\nInfo, unnecessary glob: %s (glob)" % el
+            iolock.release()
         return True
     i, n = 0, len(el)
     res = ''