tests/run-tests.py
branchstable
changeset 1255 ac0cc929e982
parent 1254 1642fcc7e2a1
child 1256 b1831d4a8d1a
equal deleted inserted replaced
1254:1642fcc7e2a1 1255:ac0cc929e982
  1285         os.umask(022)
  1285         os.umask(022)
  1286 
  1286 
  1287         checktools()
  1287         checktools()
  1288 
  1288 
  1289         if len(args) == 0:
  1289         if len(args) == 0:
  1290             args = sorted(t for t in os.listdir(".")
  1290             args = [t for t in os.listdir(".")
  1291                           if t.startswith("test-")
  1291                     if t.startswith("test-")
  1292                           and (t.endswith(".py") or t.endswith(".t")))
  1292                     and (t.endswith(".py") or t.endswith(".t"))]
  1293 
  1293 
  1294     tests = args
  1294     tests = args
  1295 
  1295 
  1296     if options.random:
  1296     if options.random:
  1297         random.shuffle(tests)
  1297         random.shuffle(tests)
       
  1298     else:
       
  1299         # run largest tests first, as they tend to take the longest
       
  1300         tests.sort(key=lambda x: -os.stat(x).st_size)
  1298 
  1301 
  1299     if 'PYTHONHASHSEED' not in os.environ:
  1302     if 'PYTHONHASHSEED' not in os.environ:
  1300         # use a random python hash seed all the time
  1303         # use a random python hash seed all the time
  1301         # we do the randomness ourself to know what seed is used
  1304         # we do the randomness ourself to know what seed is used
  1302         os.environ['PYTHONHASHSEED'] = str(random.getrandbits(32))
  1305         os.environ['PYTHONHASHSEED'] = str(random.getrandbits(32))