tests/run-tests.py
branchstable
changeset 1224 f3c19de4b29c
parent 1221 3a049b21a05b
child 1226 0dd96ff409e9
equal deleted inserted replaced
1222:01c23fd3d424 1224:f3c19de4b29c
  1118             continue
  1118             continue
  1119         rfd, wfd = os.pipe()
  1119         rfd, wfd = os.pipe()
  1120         childopts = ['--child=%d' % wfd, '--port=%d' % (options.port + j * 3)]
  1120         childopts = ['--child=%d' % wfd, '--port=%d' % (options.port + j * 3)]
  1121         childtmp = os.path.join(HGTMP, 'child%d' % j)
  1121         childtmp = os.path.join(HGTMP, 'child%d' % j)
  1122         childopts += ['--tmpdir', childtmp]
  1122         childopts += ['--tmpdir', childtmp]
       
  1123         if options.keep_tmpdir:
       
  1124             childopts.append('--keep-tmpdir')
  1123         cmdline = [PYTHON, sys.argv[0]] + opts + childopts + job
  1125         cmdline = [PYTHON, sys.argv[0]] + opts + childopts + job
  1124         vlog(' '.join(cmdline))
  1126         vlog(' '.join(cmdline))
  1125         proc = subprocess.Popen(cmdline, executable=cmdline[0])
  1127         proc = subprocess.Popen(cmdline, executable=cmdline[0])
  1126         threading.Thread(target=waitfor(proc, rfd)).start()
  1128         threading.Thread(target=waitfor(proc, rfd)).start()
  1127         os.close(wfd)
  1129         os.close(wfd)
  1286         del os.environ['HGPROF']
  1288         del os.environ['HGPROF']
  1287 
  1289 
  1288     global TESTDIR, HGTMP, INST, BINDIR, PYTHONDIR, COVERAGE_FILE
  1290     global TESTDIR, HGTMP, INST, BINDIR, PYTHONDIR, COVERAGE_FILE
  1289     TESTDIR = os.environ["TESTDIR"] = os.getcwd()
  1291     TESTDIR = os.environ["TESTDIR"] = os.getcwd()
  1290     if options.tmpdir:
  1292     if options.tmpdir:
  1291         options.keep_tmpdir = True
  1293         if not options.child:
       
  1294             options.keep_tmpdir = True
  1292         tmpdir = options.tmpdir
  1295         tmpdir = options.tmpdir
  1293         if os.path.exists(tmpdir):
  1296         if os.path.exists(tmpdir):
  1294             # Meaning of tmpdir has changed since 1.3: we used to create
  1297             # Meaning of tmpdir has changed since 1.3: we used to create
  1295             # HGTMP inside tmpdir; now HGTMP is tmpdir.  So fail if
  1298             # HGTMP inside tmpdir; now HGTMP is tmpdir.  So fail if
  1296             # tmpdir already exists.
  1299             # tmpdir already exists.