##// END OF EJS Templates
run-tests: move bisect logic to a separate method...
Jun Wu -
r34803:9c7548eb default
parent child Browse files
Show More
@@ -2085,6 +2085,20 class TextTestRunner(unittest.TextTestRu
2085 savetimes(self._runner._outputdir, result)
2085 savetimes(self._runner._outputdir, result)
2086
2086
2087 if failed and self._runner.options.known_good_rev:
2087 if failed and self._runner.options.known_good_rev:
2088 self._bisecttests(t for t, m in result.failures)
2089 self.stream.writeln(
2090 '# Ran %d tests, %d skipped, %d failed.'
2091 % (result.testsRun, skipped + ignored, failed))
2092 if failed:
2093 self.stream.writeln('python hash seed: %s' %
2094 os.environ['PYTHONHASHSEED'])
2095 if self._runner.options.time:
2096 self.printtimes(result.times)
2097 self.stream.flush()
2098
2099 return result
2100
2101 def _bisecttests(self, tests):
2088 bisectcmd = ['hg', 'bisect']
2102 bisectcmd = ['hg', 'bisect']
2089 bisectrepo = self._runner.options.bisect_repo
2103 bisectrepo = self._runner.options.bisect_repo
2090 if bisectrepo:
2104 if bisectrepo:
@@ -2094,7 +2108,7 class TextTestRunner(unittest.TextTestRu
2094 stdout=subprocess.PIPE)
2108 stdout=subprocess.PIPE)
2095 p.stdout.read()
2109 p.stdout.read()
2096 p.wait()
2110 p.wait()
2097 for test, msg in result.failures:
2111 for test in tests:
2098 nooutput(bisectcmd + ['--reset']),
2112 nooutput(bisectcmd + ['--reset']),
2099 nooutput(bisectcmd + ['--bad', '.'])
2113 nooutput(bisectcmd + ['--bad', '.'])
2100 nooutput(bisectcmd + ['--good',
2114 nooutput(bisectcmd + ['--good',
@@ -2126,17 +2140,6 class TextTestRunner(unittest.TextTestRu
2126 self.stream.writeln(
2140 self.stream.writeln(
2127 '%s %s by %s (%s)' % (
2141 '%s %s by %s (%s)' % (
2128 test, verb, dat['node'], dat['summary']))
2142 test, verb, dat['node'], dat['summary']))
2129 self.stream.writeln(
2130 '# Ran %d tests, %d skipped, %d failed.'
2131 % (result.testsRun, skipped + ignored, failed))
2132 if failed:
2133 self.stream.writeln('python hash seed: %s' %
2134 os.environ['PYTHONHASHSEED'])
2135 if self._runner.options.time:
2136 self.printtimes(result.times)
2137 self.stream.flush()
2138
2139 return result
2140
2143
2141 def printtimes(self, times):
2144 def printtimes(self, times):
2142 # iolock held by run
2145 # iolock held by run
General Comments 0
You need to be logged in to leave comments. Login now