tests/run-tests.py
branchstable
changeset 1019 e7fbd63e5a98
parent 1018 4d2cc32c6d97
child 1022 34ebea1c49c9
equal deleted inserted replaced
1018:4d2cc32c6d97 1019:e7fbd63e5a98
   868     # Make a tmp subdirectory to work in
   868     # Make a tmp subdirectory to work in
   869     testtmp = os.environ["TESTTMP"] = os.environ["HOME"] = \
   869     testtmp = os.environ["TESTTMP"] = os.environ["HOME"] = \
   870         os.path.join(HGTMP, os.path.basename(test)).replace('\\', '/')
   870         os.path.join(HGTMP, os.path.basename(test)).replace('\\', '/')
   871 
   871 
   872     replacements = [
   872     replacements = [
   873         (re.escape(testtmp), '$TESTTMP'),
       
   874         (r':%s\b' % options.port, ':$HGPORT'),
   873         (r':%s\b' % options.port, ':$HGPORT'),
   875         (r':%s\b' % (options.port + 1), ':$HGPORT1'),
   874         (r':%s\b' % (options.port + 1), ':$HGPORT1'),
   876         (r':%s\b' % (options.port + 2), ':$HGPORT2'),
   875         (r':%s\b' % (options.port + 2), ':$HGPORT2'),
   877         ]
   876         ]
   878     if os.name == 'nt':
   877     if os.name == 'nt':
   879         replacements.append((r'\r\n', '\n'))
   878         replacements.append((r'\r\n', '\n'))
       
   879         replacements.append(
       
   880             (''.join(c.isalpha() and '[%s%s]' % (c.lower(), c.upper()) or
       
   881                      c in '/\\' and r'[/\\]' or
       
   882                      c.isdigit() and c or
       
   883                      '\\' + c
       
   884                      for c in testtmp), '$TESTTMP'))
       
   885     else:
       
   886         replacements.append((re.escape(testtmp), '$TESTTMP'))
   880 
   887 
   881     os.mkdir(testtmp)
   888     os.mkdir(testtmp)
   882     ret, out = runner(testpath, testtmp, options, replacements)
   889     ret, out = runner(testpath, testtmp, options, replacements)
   883     vlog("# Ret was:", ret)
   890     vlog("# Ret was:", ret)
   884 
   891