tests/run-tests.py
changeset 19270 ac80a1cddf83
parent 19269 f4247d7e2046
child 19271 08be9601b464
equal deleted inserted replaced
19269:f4247d7e2046 19270:ac80a1cddf83
   370     env["HGPORT1"] = str(options.port + 1)
   370     env["HGPORT1"] = str(options.port + 1)
   371     env["HGPORT2"] = str(options.port + 2)
   371     env["HGPORT2"] = str(options.port + 2)
   372     env["HGRCPATH"] = os.path.join(HGTMP, '.hgrc')
   372     env["HGRCPATH"] = os.path.join(HGTMP, '.hgrc')
   373     env["DAEMON_PIDS"] = os.path.join(HGTMP, 'daemon.pids')
   373     env["DAEMON_PIDS"] = os.path.join(HGTMP, 'daemon.pids')
   374 
   374 
       
   375     # Reset some environment variables to well-known values so that
       
   376     # the tests produce repeatable output.
       
   377     env['LANG'] = env['LC_ALL'] = env['LANGUAGE'] = 'C'
       
   378     env['TZ'] = 'GMT'
       
   379     env["EMAIL"] = "Foo Bar <foo.bar@example.com>"
       
   380     env['COLUMNS'] = '80'
       
   381     env['TERM'] = 'xterm'
       
   382 
       
   383     env['CDPATH'] = ''
       
   384     env['GREP_OPTIONS'] = ''
       
   385     env['http_proxy'] = ''
       
   386     env['no_proxy'] = ''
       
   387     env['NO_PROXY'] = ''
       
   388 
       
   389     # unset env related to hooks
       
   390     for k in env.keys():
       
   391         if k.startswith('HG_'):
       
   392             del env[k]
       
   393     if 'HG' in env:
       
   394         del env['HG']
       
   395     if 'HGPROF' in env:
       
   396         del env['HGPROF']
       
   397 
   375     return env
   398     return env
   376 
   399 
   377 def checktools():
   400 def checktools():
   378     # Before we go any further, check for pre-requisite tools
   401     # Before we go any further, check for pre-requisite tools
   379     # stuff from coreutils (cat, rm, etc) are not tested
   402     # stuff from coreutils (cat, rm, etc) are not tested
  1241     tests = args
  1264     tests = args
  1242 
  1265 
  1243     if options.random:
  1266     if options.random:
  1244         random.shuffle(tests)
  1267         random.shuffle(tests)
  1245 
  1268 
  1246     # Reset some environment variables to well-known values so that
       
  1247     # the tests produce repeatable output.
       
  1248     os.environ['LANG'] = os.environ['LC_ALL'] = os.environ['LANGUAGE'] = 'C'
       
  1249     os.environ['TZ'] = 'GMT'
       
  1250     os.environ["EMAIL"] = "Foo Bar <foo.bar@example.com>"
       
  1251     os.environ['CDPATH'] = ''
       
  1252     os.environ['COLUMNS'] = '80'
       
  1253     os.environ['GREP_OPTIONS'] = ''
       
  1254     os.environ['http_proxy'] = ''
       
  1255     os.environ['no_proxy'] = ''
       
  1256     os.environ['NO_PROXY'] = ''
       
  1257     os.environ['TERM'] = 'xterm'
       
  1258     if 'PYTHONHASHSEED' not in os.environ:
  1269     if 'PYTHONHASHSEED' not in os.environ:
  1259         # use a random python hash seed all the time
  1270         # use a random python hash seed all the time
  1260         # we do the randomness ourself to know what seed is used
  1271         # we do the randomness ourself to know what seed is used
  1261         os.environ['PYTHONHASHSEED'] = str(random.getrandbits(32))
  1272         os.environ['PYTHONHASHSEED'] = str(random.getrandbits(32))
  1262         print 'python hash seed:', os.environ['PYTHONHASHSEED']
  1273         print 'python hash seed:', os.environ['PYTHONHASHSEED']
  1263 
       
  1264     # unset env related to hooks
       
  1265     for k in os.environ.keys():
       
  1266         if k.startswith('HG_'):
       
  1267             # can't remove on solaris
       
  1268             os.environ[k] = ''
       
  1269             del os.environ[k]
       
  1270     if 'HG' in os.environ:
       
  1271         # can't remove on solaris
       
  1272         os.environ['HG'] = ''
       
  1273         del os.environ['HG']
       
  1274     if 'HGPROF' in os.environ:
       
  1275         os.environ['HGPROF'] = ''
       
  1276         del os.environ['HGPROF']
       
  1277 
  1274 
  1278     global TESTDIR, HGTMP, INST, BINDIR, PYTHONDIR, COVERAGE_FILE
  1275     global TESTDIR, HGTMP, INST, BINDIR, PYTHONDIR, COVERAGE_FILE
  1279     TESTDIR = os.environ["TESTDIR"] = os.getcwd()
  1276     TESTDIR = os.environ["TESTDIR"] = os.getcwd()
  1280     if options.tmpdir:
  1277     if options.tmpdir:
  1281         if not options.child:
  1278         if not options.child: