run-tests: move output writing to Test.run()
authorGregory Szorc <gregory.szorc@gmail.com>
Sat, 19 Apr 2014 21:17:39 -0700
changeset 21335 822050714e72
parent 21334 6a90ecb6597a
child 21336 45ab0668d1b2
run-tests: move output writing to Test.run()
tests/run-tests.py
--- a/tests/run-tests.py	Sat Apr 19 21:14:31 2014 -0700
+++ b/tests/run-tests.py	Sat Apr 19 21:17:39 2014 -0700
@@ -627,8 +627,6 @@
         try:
             ret, out = self._run(testtmp, replacements, env)
             updateduration()
-            result.ret = ret
-            result.out = out
         except KeyboardInterrupt:
             updateduration()
             log('INTERRUPTED: %s (after %d seconds)' % (self._test,
@@ -698,6 +696,14 @@
                 f.write(line)
             f.close()
 
+        vlog("# Ret was:", ret)
+
+        if not options.verbose:
+            iolock.acquire()
+            sys.stdout.write(res[0])
+            sys.stdout.flush()
+            iolock.release()
+
         return res
 
     def _run(self, testtmp, replacements, env):
@@ -793,8 +799,6 @@
     """Holds the result of a test execution."""
 
     def __init__(self):
-        self.ret = None
-        self.out = None
         self.duration = None
         self.skipped = False
 
@@ -1157,17 +1161,7 @@
     res = TestResult()
     result = t.run(res)
 
-    ret = res.ret
-    out = res.out
-
     times.append((test, res.duration))
-    vlog("# Ret was:", ret)
-
-    if not options.verbose:
-        iolock.acquire()
-        sys.stdout.write(result[0])
-        sys.stdout.flush()
-        iolock.release()
 
     t.cleanup()