changeset 15451:23144f06919c

run-tests: make $TESTTMP matching case-insensitive on windows
author Mads Kiilerich <mads@kiilerich.com>
date Mon, 07 Nov 2011 03:25:10 +0100
parents 90c15a7573df
children de7e2fba4326
files tests/run-tests.py
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/tests/run-tests.py	Mon Nov 07 03:25:10 2011 +0100
+++ b/tests/run-tests.py	Mon Nov 07 03:25:10 2011 +0100
@@ -870,13 +870,20 @@
         os.path.join(HGTMP, os.path.basename(test)).replace('\\', '/')
 
     replacements = [
-        (re.escape(testtmp), '$TESTTMP'),
         (r':%s\b' % options.port, ':$HGPORT'),
         (r':%s\b' % (options.port + 1), ':$HGPORT1'),
         (r':%s\b' % (options.port + 2), ':$HGPORT2'),
         ]
     if os.name == 'nt':
         replacements.append((r'\r\n', '\n'))
+        replacements.append(
+            (''.join(c.isalpha() and '[%s%s]' % (c.lower(), c.upper()) or
+                     c in '/\\' and r'[/\\]' or
+                     c.isdigit() and c or
+                     '\\' + c
+                     for c in testtmp), '$TESTTMP'))
+    else:
+        replacements.append((re.escape(testtmp), '$TESTTMP'))
 
     os.mkdir(testtmp)
     ret, out = runner(testpath, testtmp, options, replacements)