[PATCH 5 of 5] run-tests: spread and document the content of time tuple

Pierre-Yves David pierre-yves.david at ens-lyon.org
Fri May 8 13:53:58 CDT 2015


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at fb.com>
# Date 1431066313 25200
#      Thu May 07 23:25:13 2015 -0700
# Node ID 0863fb786f918cce226eb1a2c0e4306a3cba79f0
# Parent  470fb04e8380ec184d9b61f4a6194aa532ef2a7a
run-tests: spread and document the content of time tuple

The spreading will make future modification clearer. The documentation improve
code readability.

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -1301,12 +1301,15 @@ class TestResult(unittest._TextTestResul
 
         test.stopped = os.times()
 
         starttime = test.started
         endtime = test.stopped
-        self.times.append((test.name, endtime[2] - starttime[2],
-                    endtime[3] - starttime[3], endtime[4] - starttime[4]))
+        self.times.append((test.name,
+                           endtime[2] - starttime[2], # user space CPU time
+                           endtime[3] - starttime[3], # sys  space CPU time
+                           endtime[4] - starttime[4], # real time
+                           ))
 
         if interrupted:
             iolock.acquire()
             self.stream.writeln('INTERRUPTED: %s (after %d seconds)' % (
                 test.name, self.times[-1][3]))


More information about the Mercurial-devel mailing list