comparison tests/run-tests.py @ 19277:09e1c148e847

run-tests: schedule largest tests first
author Matt Mackall <mpm@selenic.com>
date Sun, 02 Jun 2013 17:56:51 -0500
parents e55751963889
children bc35b9ed3ae7
comparison
equal deleted inserted replaced
19276:e55751963889 19277:09e1c148e847
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))