# HG changeset patch # User Martin von Zweigbergk # Date 1517469165 28800 # Node ID 56891705924367769a6f29b66e8833d403c36ea8 # Parent 2f7ab4fb77114cee95138263236e2270b1309bfd testrunner: make reading of test times work with #testcases Due to a bug that will be fixed in the next patch, we never actually read back .testcases, so we didn't notice that it could not be parsed successfully when there are #testcases tests. The parsing failed on lines like "test-amend-subrepo.t (case obsstore-off) 32.420" because we used a simple string.split() call and expected all parts but the first to be floating point numbers (and "(case" isn't, for example). Fix by using a regex instead. Differential Revision: https://phab.mercurial-scm.org/D1960 diff -r 2f7ab4fb7711 -r 568917059243 tests/run-tests.py --- a/tests/run-tests.py Wed Jan 31 11:04:16 2018 -0800 +++ b/tests/run-tests.py Wed Jan 31 23:12:45 2018 -0800 @@ -2019,8 +2019,9 @@ try: with open(os.path.join(outputdir, b'.testtimes-')) as fp: for line in fp: - ts = line.split() - times.append((ts[0], [float(t) for t in ts[1:]])) + m = re.match('(.*?) ([0-9. ]+)', line) + times.append((m.group(1), + [float(t) for t in m.group(2).split()])) except IOError as err: if err.errno != errno.ENOENT: raise