run-tests: pass TestResult into run()
authorGregory Szorc <gregory.szorc@gmail.com>
Sat, 19 Apr 2014 18:31:22 -0700
changeset 21306 cbf5475827da
parent 21305 d7a7825ff2cf
child 21307 cd4fd7b3c3c4
run-tests: pass TestResult into run()
tests/run-tests.py
--- a/tests/run-tests.py	Sat Apr 19 13:50:25 2014 -0700
+++ b/tests/run-tests.py	Sat Apr 19 18:31:22 2014 -0700
@@ -559,11 +559,10 @@
 
         self._setreplacements(count)
 
-    def run(self):
+    def run(self, result):
         env = self._getenv()
         createhgrc(env['HGRCPATH'], self._options)
 
-        result = TestResult()
         starttime = time.time()
 
         def updateduration():
@@ -583,8 +582,6 @@
 
         killdaemons(env['DAEMON_PIDS'])
 
-        return result
-
     def _run(self, replacements, env):
         raise NotImplemented('Subclasses must implement Test.run()')
 
@@ -1052,7 +1049,8 @@
         os.remove(err)       # Remove any previous output files
 
     t = runner(testpath, options, count)
-    res = t.run()
+    res = TestResult()
+    t.run(res)
 
     if res.interrupted:
         log('INTERRUPTED: %s (after %d seconds)' % (test, res.duration))