Show More
@@ -1845,18 +1845,24 b' class TestRunner(object):' | |||||
1845 | b'gendoc': 100, |
|
1845 | b'gendoc': 100, | |
1846 | b'contrib-perf': 200, |
|
1846 | b'contrib-perf': 200, | |
1847 | } |
|
1847 | } | |
|
1848 | perf = {} | |||
1848 | def sortkey(f): |
|
1849 | def sortkey(f): | |
1849 | # run largest tests first, as they tend to take the longest |
|
1850 | # run largest tests first, as they tend to take the longest | |
1850 | try: |
|
1851 | try: | |
1851 | val = -os.stat(f).st_size |
|
1852 | return perf[f] | |
1852 |
except |
|
1853 | except KeyError: | |
1853 |
|
|
1854 | try: | |
1854 |
|
|
1855 | val = -os.stat(f).st_size | |
1855 | return -1e9 # file does not exist, tell early |
|
1856 | except OSError as e: | |
1856 | for kw, mul in slow.items(): |
|
1857 | if e.errno != errno.ENOENT: | |
1857 |
|
|
1858 | raise | |
1858 | val *= mul |
|
1859 | perf[f] = -1e9 # file does not exist, tell early | |
1859 |
return |
|
1860 | return -1e9 | |
|
1861 | for kw, mul in slow.items(): | |||
|
1862 | if kw in f: | |||
|
1863 | val *= mul | |||
|
1864 | perf[f] = val | |||
|
1865 | return perf[f] | |||
1860 | tests.sort(key=sortkey) |
|
1866 | tests.sort(key=sortkey) | |
1861 |
|
1867 | |||
1862 | self._testdir = osenvironb[b'TESTDIR'] = getattr( |
|
1868 | self._testdir = osenvironb[b'TESTDIR'] = getattr( |
General Comments 0
You need to be logged in to leave comments.
Login now