# HG changeset patch # User Martin von Zweigbergk # Date 2018-02-01 07:12:45 # 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 --git a/tests/run-tests.py b/tests/run-tests.py --- a/tests/run-tests.py +++ b/tests/run-tests.py @@ -2019,8 +2019,9 @@ def loadtimes(outputdir): 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