From 474c98fe263455f97f764195d44fb7b7406748b0 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 5 Sep 2010 03:14:44 +0200 Subject: selftest/subunit: Parse timestamps generated by upstream subunit. --- selftest/subunithelper.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'selftest') diff --git a/selftest/subunithelper.py b/selftest/subunithelper.py index 06e1fc2edc..f5e07a1d9a 100644 --- a/selftest/subunithelper.py +++ b/selftest/subunithelper.py @@ -45,8 +45,14 @@ def parse_results(msg_ops, statistics, fh): elif command == "time": msg_ops.control_msg(l) grp = re.match( - "(\d+)-(\d+)-(\d+) (\d+):(\d+):(\d+)\n", arg) - msg_ops.report_time(time.mktime((int(grp.group(1)), int(grp.group(2)), int(grp.group(3)), int(grp.group(4)), int(grp.group(5)), int(grp.group(6)), 0, 0, 0))) + '(\d+)-(\d+)-(\d+) (\d+):(\d+):([.0-9]+)\n', arg) + if grp is None: + grp = re.match( + '(\d+)-(\d+)-(\d+) (\d+):(\d+):([.0-9]+)Z\n', arg) + if grp is None: + print "Unable to parse time line: %s" % arg + if grp is not None: + msg_ops.report_time(time.mktime((int(grp.group(1)), int(grp.group(2)), int(grp.group(3)), int(grp.group(4)), int(grp.group(5)), int(float(grp.group(6))), 0, 0, 0))) elif command in VALID_RESULTS: msg_ops.control_msg(l) result = command -- cgit