run-tests: allow different extra weight for slow tests
The 'test-check-code-hg.t' file is not big enough to be prioritized properly.
As a result my tests run often spend about 15 seconds running only it at the
end of its tests run. We make the "slow" mechanism a bit smarter to adjust the
extra weight of each category independently in a future patch.
--- a/tests/run-tests.py Thu May 07 21:00:46 2015 -0700
+++ b/tests/run-tests.py Fri May 08 00:04:07 2015 -0700
@@ -1662,7 +1662,10 @@
random.shuffle(tests)
else:
# keywords for slow tests
- slow = b'svn gendoc check-code-hg'.split()
+ slow = {b'svn': 10,
+ b'gendoc': 10,
+ b'check-code-hg': 10,
+ }
def sortkey(f):
# run largest tests first, as they tend to take the longest
try:
@@ -1671,9 +1674,9 @@
if e.errno != errno.ENOENT:
raise
return -1e9 # file does not exist, tell early
- for kw in slow:
+ for kw, mul in slow.iteritems():
if kw in f:
- val *= 10
+ val *= mul
return val
tests.sort(key=sortkey)