tests/run-tests.py
changeset 19267 6a7c76395b4c
parent 19266 7815917b5f2a
child 19268 36dc45b1f427
equal deleted inserted replaced
19266:7815917b5f2a 19267:6a7c76395b4c
   350     hgrc.write('tag = -d "0 0"\n')
   350     hgrc.write('tag = -d "0 0"\n')
   351     if options.inotify:
   351     if options.inotify:
   352         hgrc.write('[extensions]\n')
   352         hgrc.write('[extensions]\n')
   353         hgrc.write('inotify=\n')
   353         hgrc.write('inotify=\n')
   354         hgrc.write('[inotify]\n')
   354         hgrc.write('[inotify]\n')
   355         hgrc.write('pidfile=%s\n' % DAEMON_PIDS)
   355         hgrc.write('pidfile=daemon.pids')
   356         hgrc.write('appendpid=True\n')
   356         hgrc.write('appendpid=True\n')
   357     if options.extra_config_opt:
   357     if options.extra_config_opt:
   358         for opt in options.extra_config_opt:
   358         for opt in options.extra_config_opt:
   359             section, key = opt.split('.', 1)
   359             section, key = opt.split('.', 1)
   360             assert '=' in key, ('extra config opt %s must '
   360             assert '=' in key, ('extra config opt %s must '
   933     env['TESTTMP'] = testtmp
   933     env['TESTTMP'] = testtmp
   934     env['HOME'] = testtmp
   934     env['HOME'] = testtmp
   935     env["HGPORT"] = str(options.port)
   935     env["HGPORT"] = str(options.port)
   936     env["HGPORT1"] = str(options.port + 1)
   936     env["HGPORT1"] = str(options.port + 1)
   937     env["HGPORT2"] = str(options.port + 2)
   937     env["HGPORT2"] = str(options.port + 2)
       
   938     env["DAEMON_PIDS"] = os.path.join(HGTMP, 'daemon.pids')
   938 
   939 
   939     if options.time:
   940     if options.time:
   940         starttime = time.time()
   941         starttime = time.time()
   941     ret, out = runner(testpath, testtmp, options, replacements, env)
   942     ret, out = runner(testpath, testtmp, options, replacements, env)
   942     if options.time:
   943     if options.time:
  1164 
  1165 
  1165         if options.first and code not in '.si':
  1166         if options.first and code not in '.si':
  1166             break
  1167             break
  1167 
  1168 
  1168 def runtests(options, tests):
  1169 def runtests(options, tests):
  1169     global DAEMON_PIDS, HGRCPATH
  1170     global HGRCPATH
  1170     DAEMON_PIDS = os.environ["DAEMON_PIDS"] = os.path.join(HGTMP, 'daemon.pids')
       
  1171     HGRCPATH = os.environ["HGRCPATH"] = os.path.join(HGTMP, '.hgrc')
  1171     HGRCPATH = os.environ["HGRCPATH"] = os.path.join(HGTMP, '.hgrc')
  1172 
  1172 
  1173     try:
  1173     try:
  1174         if INST:
  1174         if INST:
  1175             installhg(options)
  1175             installhg(options)
  1298             # without this, we get the default temp dir location, but
  1298             # without this, we get the default temp dir location, but
  1299             # in all lowercase, which causes troubles with paths (issue3490)
  1299             # in all lowercase, which causes troubles with paths (issue3490)
  1300             d = os.getenv('TMP')
  1300             d = os.getenv('TMP')
  1301         tmpdir = tempfile.mkdtemp('', 'hgtests.', d)
  1301         tmpdir = tempfile.mkdtemp('', 'hgtests.', d)
  1302     HGTMP = os.environ['HGTMP'] = os.path.realpath(tmpdir)
  1302     HGTMP = os.environ['HGTMP'] = os.path.realpath(tmpdir)
  1303     DAEMON_PIDS = None
       
  1304     HGRCPATH = None
  1303     HGRCPATH = None
  1305 
  1304 
  1306     os.environ["HGEDITOR"] = sys.executable + ' -c "import sys; sys.exit(0)"'
  1305     os.environ["HGEDITOR"] = sys.executable + ' -c "import sys; sys.exit(0)"'
  1307     os.environ["HGMERGE"] = "internal:merge"
  1306     os.environ["HGMERGE"] = "internal:merge"
  1308     os.environ["HGUSER"]   = "test"
  1307     os.environ["HGUSER"]   = "test"