tests/run-tests.py
branchstable
changeset 1243 00ca4c2f51cc
parent 1242 2d7fa9712652
child 1244 1168e50a48e5
equal deleted inserted replaced
1242:2d7fa9712652 1243:00ca4c2f51cc
   909 
   909 
   910     if os.path.exists(err):
   910     if os.path.exists(err):
   911         os.remove(err)       # Remove any previous output files
   911         os.remove(err)       # Remove any previous output files
   912 
   912 
   913     # Make a tmp subdirectory to work in
   913     # Make a tmp subdirectory to work in
   914     testtmp = os.environ["TESTTMP"] = os.environ["HOME"] = \
   914     testtmp = os.path.join(HGTMP, os.path.basename(test))
   915         os.path.join(HGTMP, os.path.basename(test))
       
   916     os.mkdir(testtmp)
   915     os.mkdir(testtmp)
   917 
   916 
   918     replacements = [
   917     replacements = [
   919         (r':%s\b' % options.port, ':$HGPORT'),
   918         (r':%s\b' % options.port, ':$HGPORT'),
   920         (r':%s\b' % (options.port + 1), ':$HGPORT1'),
   919         (r':%s\b' % (options.port + 1), ':$HGPORT1'),
   929                      for c in testtmp), '$TESTTMP'))
   928                      for c in testtmp), '$TESTTMP'))
   930     else:
   929     else:
   931         replacements.append((re.escape(testtmp), '$TESTTMP'))
   930         replacements.append((re.escape(testtmp), '$TESTTMP'))
   932 
   931 
   933     env = os.environ.copy()
   932     env = os.environ.copy()
       
   933     env['TESTTMP'] = testtmp
       
   934     env['HOME'] = testtmp
   934 
   935 
   935     if options.time:
   936     if options.time:
   936         starttime = time.time()
   937         starttime = time.time()
   937     ret, out = runner(testpath, testtmp, options, replacements, env)
   938     ret, out = runner(testpath, testtmp, options, replacements, env)
   938     if options.time:
   939     if options.time: