changeset 24983:277bc9b0b4bd

run-tests: when building json, get time data in the same order as elsewhere The json code was changing the order of the time tuple for unclear reasons. We now use the same order as everywhere else.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Thu, 07 May 2015 23:16:57 -0700
parents 5c15f7e0f52b
children 5195322b9f80
files tests/run-tests.py
diffstat 1 files changed, 4 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/tests/run-tests.py	Thu May 07 20:45:51 2015 -0700
+++ b/tests/run-tests.py	Thu May 07 23:16:57 2015 -0700
@@ -1532,8 +1532,7 @@
                 timesd = {}
                 for tdata in result.times:
                     test = tdata[0]
-                    real, cuser, csys = tdata[3], tdata[1], tdata[2]
-                    timesd[test] = (real, cuser, csys)
+                    timesd[test] = tdata[1:]
 
                 outcome = {}
                 groups = [('success', ((tc, None) for tc in result.successes)),
@@ -1542,9 +1541,9 @@
                 for res, testcases in groups:
                     for tc, __ in testcases:
                         testresult = {'result': res,
-                                      'time': ('%0.3f' % timesd[tc.name][0]),
-                                      'cuser': ('%0.3f' % timesd[tc.name][1]),
-                                      'csys': ('%0.3f' % timesd[tc.name][2])}
+                                      'time': ('%0.3f' % timesd[tc.name][2]),
+                                      'cuser': ('%0.3f' % timesd[tc.name][0]),
+                                      'csys': ('%0.3f' % timesd[tc.name][1])}
                         outcome[tc.name] = testresult
 
                 jsonout = json.dumps(outcome, sort_keys=True, indent=4)