run-tests: when building json, get time data in the same order as elsewhere
authorPierre-Yves David <pierre-yves.david@fb.com>
Thu, 07 May 2015 23:16:57 -0700
changeset 24983 277bc9b0b4bd
parent 24982 5c15f7e0f52b
child 24984 5195322b9f80
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.
tests/run-tests.py
--- 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)