run-tests: store test return code and output in Test instance
authorGregory Szorc <gregory.szorc@gmail.com>
Sun, 20 Apr 2014 14:58:36 -0700
changeset 21449 aedf18bcde11
parent 21448 f2dbbcacc763
child 21450 a6e40416f172
run-tests: store test return code and output in Test instance A subsequent patch that will introduce tearDown() requires test execution state be stored in the instance.
tests/run-tests.py
--- a/tests/run-tests.py	Sun Apr 20 14:55:33 2014 -0700
+++ b/tests/run-tests.py	Sun Apr 20 14:58:36 2014 -0700
@@ -357,6 +357,8 @@
         self._unittest = unittest
 
         self._finished = None
+        self._ret = None
+        self._out = None
 
         # If we're not in --debug mode and reference output file exists,
         # check test output against it.
@@ -382,6 +384,8 @@
     def setUp(self):
         """Tasks to perform before run()."""
         self._finished = False
+        self._ret = None
+        self._out = None
 
     def run(self):
         """Run this test instance.
@@ -433,6 +437,8 @@
             ret, out = self._run(testtmp, replacements, env)
             duration = time.time() - starttime
             self._finished = True
+            self._ret = ret
+            self._out = out
         except KeyboardInterrupt:
             duration = time.time() - starttime
             log('INTERRUPTED: %s (after %d seconds)' % (self.name, duration))