Mercurial > public > mercurial-scm > hg
comparison tests/run-tests.py @ 43593:ae91e4e4c9b0
tests: rename stopped and started variables to reflect times
In preparation for introducing more variables that will have
similar names.
Differential Revision: https://phab.mercurial-scm.org/D7125
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Wed, 16 Oct 2019 21:25:08 -0700 |
parents | d9e7ac50b80a |
children | ac140b85aae9 |
comparison
equal
deleted
inserted
replaced
43592:61d7bca16dff | 43593:ae91e4e4c9b0 |
---|---|
2245 | 2245 |
2246 # os.times module computes the user time and system time spent by | 2246 # os.times module computes the user time and system time spent by |
2247 # child's processes along with real elapsed time taken by a process. | 2247 # child's processes along with real elapsed time taken by a process. |
2248 # This module has one limitation. It can only work for Linux user | 2248 # This module has one limitation. It can only work for Linux user |
2249 # and not for Windows. | 2249 # and not for Windows. |
2250 test.started = os.times() | 2250 test.started_times = os.times() |
2251 if self._firststarttime is None: # thread racy but irrelevant | 2251 if self._firststarttime is None: # thread racy but irrelevant |
2252 self._firststarttime = test.started[4] | 2252 self._firststarttime = test.started_times[4] |
2253 | 2253 |
2254 def stopTest(self, test, interrupted=False): | 2254 def stopTest(self, test, interrupted=False): |
2255 super(TestResult, self).stopTest(test) | 2255 super(TestResult, self).stopTest(test) |
2256 | 2256 |
2257 test.stopped = os.times() | 2257 test.stopped_times = os.times() |
2258 | 2258 |
2259 starttime = test.started | 2259 starttime = test.started_times |
2260 endtime = test.stopped | 2260 endtime = test.stopped_times |
2261 origin = self._firststarttime | 2261 origin = self._firststarttime |
2262 self.times.append( | 2262 self.times.append( |
2263 ( | 2263 ( |
2264 test.name, | 2264 test.name, |
2265 endtime[2] - starttime[2], # user space CPU time | 2265 endtime[2] - starttime[2], # user space CPU time |