diff tests/run-tests.py @ 15449:f71d60da58fb

tests: ignore \r on windows
author Mads Kiilerich <mads@kiilerich.com>
date Mon, 07 Nov 2011 03:25:10 +0100
parents 873f94ecd706
children 90c15a7573df
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
@@ -557,7 +557,9 @@
         (el.endswith(" (re)\n") and rematch(el[:-6] + '\n', l) or
          el.endswith(" (glob)\n") and globmatch(el[:-8] + '\n', l) or
          el.endswith(" (esc)\n") and
-             el[:-7].decode('string-escape') + '\n' == l)):
+             (el[:-7].decode('string-escape') + '\n' == l or
+              el[:-7].decode('string-escape').replace('\r', '') +
+                  '\n' == l and os.name == 'nt'))):
         return True
     return False
 
@@ -867,13 +869,17 @@
     testtmp = os.environ["TESTTMP"] = os.environ["HOME"] = \
         os.path.join(HGTMP, os.path.basename(test)).replace('\\', '/')
 
-    os.mkdir(testtmp)
-    ret, out = runner(testpath, testtmp, options, [
+    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'))
+
+    os.mkdir(testtmp)
+    ret, out = runner(testpath, testtmp, options, replacements)
     vlog("# Ret was:", ret)
 
     mark = '.'