Mercurial > hg
comparison tests/run-tests.py @ 21740:2b3b60031b6f
run-tests: fixes the number of tests ran when '--retest' is enabled
This patch fixes a regression recently introduced by a refactoring. (see
92a6b16c9186 and about 200 previous changesets from Gregory Szorc)
While retesting, that is when '--retest' is enabled, only failure tests run
and others either skipped or ignored.
During retesting, "result.testsRun" holds the count of failure test that has
run. But as while printing output, we have subtracted the skipped and ignored
count from "result.testsRun". Therefore, to make the count remain
the same, we need to add skipped and ignored count before printing.
author | anuraggoel <anurag.dsps@gmail.com> |
---|---|
date | Thu, 12 Jun 2014 03:20:28 +0530 |
parents | 11e5ad038a7b |
children | b7baef94a333 |
comparison
equal
deleted
inserted
replaced
21739:11e5ad038a7b | 21740:2b3b60031b6f |
---|---|
1314 for test, msg in result.errors: | 1314 for test, msg in result.errors: |
1315 self.stream.writeln('Errored %s: %s' % (test.name, msg)) | 1315 self.stream.writeln('Errored %s: %s' % (test.name, msg)) |
1316 | 1316 |
1317 self._runner._checkhglib('Tested') | 1317 self._runner._checkhglib('Tested') |
1318 | 1318 |
1319 # When '--retest' is enabled, only failure tests run. At this point | |
1320 # "result.testsRun" holds the count of failure test that has run. But | |
1321 # as while printing output, we have subtracted the skipped and ignored | |
1322 # count from "result.testsRun". Therefore, to make the count remain | |
1323 # the same, we need to add skipped and ignored count in here. | |
1324 if self._runner.options.retest: | |
1325 result.testsRun = result.testsRun + skipped + ignored | |
1326 | |
1319 # This differs from unittest's default output in that we don't count | 1327 # This differs from unittest's default output in that we don't count |
1320 # skipped and ignored tests as part of the total test count. | 1328 # skipped and ignored tests as part of the total test count. |
1321 self.stream.writeln('# Ran %d tests, %d skipped, %d warned, %d failed.' | 1329 self.stream.writeln('# Ran %d tests, %d skipped, %d warned, %d failed.' |
1322 % (result.testsRun - skipped - ignored, | 1330 % (result.testsRun - skipped - ignored, |
1323 skipped + ignored, warned, failed)) | 1331 skipped + ignored, warned, failed)) |