changeset 21322:512968bfb00a

run-tests: move success() into Test
author Gregory Szorc <gregory.szorc@gmail.com>
date Sat, 19 Apr 2014 20:35:54 -0700
parents d06b09dc80a5
children a7c677e2f6ae
files tests/run-tests.py
diffstat 1 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/tests/run-tests.py	Sat Apr 19 20:32:38 2014 -0700
+++ b/tests/run-tests.py	Sat Apr 19 20:35:54 2014 -0700
@@ -675,6 +675,9 @@
 
         return env
 
+    def success(self):
+        return '.', self._test, ''
+
 class TestResult(object):
     """Holds the result of a test execution."""
 
@@ -1049,9 +1052,6 @@
                 return '.', test, ''
         return warned and '~' or '!', test, msg
 
-    def success():
-        return '.', test, ''
-
     def ignore(msg):
         return 'i', test, msg
 
@@ -1099,7 +1099,6 @@
     t = runner(test, testpath, options, count, ref, err)
     res = TestResult()
     t.run(res)
-    t.cleanup()
 
     if res.exception:
         return fail('Exception during execution: %s' % res.exception, 255)
@@ -1154,7 +1153,7 @@
     elif ret:
         result = fail(describe(ret), ret)
     else:
-        result = success()
+        result = t.success()
 
     if not options.verbose:
         iolock.acquire()
@@ -1162,6 +1161,8 @@
         sys.stdout.flush()
         iolock.release()
 
+    t.cleanup()
+
     return result
 
 _hgpath = None