Mercurial > hg
comparison tests/run-tests.py @ 25098:bf84ab53c2fd
run-tests: include 'start' and 'end' in --time output
This is useful information to understand what is taking time in tests. Both are
included because I can see myself sorting this output using shell script. Having
both data makes it much easier than extracting 'start'+'real'.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Thu, 07 May 2015 23:40:29 -0700 |
parents | a4fce7905721 |
children | 149cc7663ac8 |
comparison
equal
deleted
inserted
replaced
25097:a4fce7905721 | 25098:bf84ab53c2fd |
---|---|
1601 | 1601 |
1602 def printtimes(self, times): | 1602 def printtimes(self, times): |
1603 # iolock held by run | 1603 # iolock held by run |
1604 self.stream.writeln('# Producing time report') | 1604 self.stream.writeln('# Producing time report') |
1605 times.sort(key=lambda t: (t[3])) | 1605 times.sort(key=lambda t: (t[3])) |
1606 cols = '%7.3f %7.3f %7.3f %s' | 1606 cols = '%7.3f %7.3f %7.3f %7.3f %7.3f %s' |
1607 self.stream.writeln('%-7s %-7s %-7s %s' % ('cuser', 'csys', 'real', | 1607 self.stream.writeln('%-7s %-7s %-7s %-7s %-7s %s' % |
1608 'Test')) | 1608 ('start', 'end', 'cuser', 'csys', 'real', 'Test')) |
1609 for tdata in times: | 1609 for tdata in times: |
1610 test = tdata[0] | 1610 test = tdata[0] |
1611 cuser, csys, real = tdata[1:4] | 1611 cuser, csys, real, start, end = tdata[1:6] |
1612 self.stream.writeln(cols % (cuser, csys, real, test)) | 1612 self.stream.writeln(cols % (start, end, cuser, csys, real, test)) |
1613 | 1613 |
1614 class TestRunner(object): | 1614 class TestRunner(object): |
1615 """Holds context for executing tests. | 1615 """Holds context for executing tests. |
1616 | 1616 |
1617 Tests rely on a lot of state. This object holds it for them. | 1617 Tests rely on a lot of state. This object holds it for them. |