mailr14787 - in /1.3/test_suite: gui_tests/__init__.py system_tests/__init__.py test_suite_runner.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on October 05, 2011 - 15:10:
Author: bugman
Date: Wed Oct  5 15:10:42 2011
New Revision: 14787

URL: http://svn.gna.org/viewcvs/relax?rev=14787&view=rev
Log:
The test result handling is now performed 100% in test_suite_runner.

Previously each class of test (system, unit, and GUI) were managing a 
separate instance of
RelaxTestRunner.  Now it is all controlled from one spot.  This will allow 
better management of the
tests from the GUI.


Modified:
    1.3/test_suite/gui_tests/__init__.py
    1.3/test_suite/system_tests/__init__.py
    1.3/test_suite/test_suite_runner.py

Modified: 1.3/test_suite/gui_tests/__init__.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/test_suite/gui_tests/__init__.py?rev=14787&r1=14786&r2=14787&view=diff
==============================================================================
--- 1.3/test_suite/gui_tests/__init__.py (original)
+++ 1.3/test_suite/gui_tests/__init__.py Wed Oct  5 15:10:42 2011
@@ -28,9 +28,6 @@
 from string import split
 from unittest import TestSuite
 
-# relax module imports.
-from test_suite.relax_test_runner import RelaxTestRunner
-
 # relax GUI test module imports.
 from model_free import Mf
 from noe import Noe
@@ -48,14 +45,16 @@
 class GUI_test_runner:
     """Class for executing all of the GUI tests."""
 
-    def run(self, tests=None):
+    def run(self, tests=None, runner=None):
         """Run the GUI tests.
 
         The GUI test list should be something like 
['N_state_model.test_stereochem_analysis'].  The first part is the imported 
test case class, the second is the specific test.
 
 
-        @keyword tests: The list of GUI tests to preform.
-        @type tests:    list of str
+        @keyword tests:     The list of GUI tests to preform.
+        @type tests:        list of str
+        @keyword runner:    A test runner such as TextTestRunner.  For an 
example of how to write a test runner see the python documentation for 
TextTestRunner in the python source.
+        @type runner:       Test runner instance (TextTestRunner, 
BaseGUITestRunner subclass, etc.)
         """
 
         # Create an array of test suites (add your new TestCase classes 
here).
@@ -90,7 +89,7 @@
         full_suite = TestSuite(suite_array)
 
         # Run the test suite.
-        results = RelaxTestRunner().run(full_suite)
+        results = runner.run(full_suite)
 
         # Return the status of the tests.
         return results.wasSuccessful()

Modified: 1.3/test_suite/system_tests/__init__.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/test_suite/system_tests/__init__.py?rev=14787&r1=14786&r2=14787&view=diff
==============================================================================
--- 1.3/test_suite/system_tests/__init__.py (original)
+++ 1.3/test_suite/system_tests/__init__.py Wed Oct  5 15:10:42 2011
@@ -27,9 +27,6 @@
 from relax_errors import RelaxError
 from string import split
 from unittest import TestSuite
-
-# relax module imports.
-from test_suite.relax_test_runner import RelaxTestRunner
 
 # relax system/functional test module imports.
 from align_tensor import Align_tensor
@@ -94,14 +91,16 @@
 class System_test_runner:
     """Class for executing all of the system/functional tests."""
 
-    def run(self, tests=None):
+    def run(self, tests=None, runner=None):
         """Run the system/functional tests.
 
         The system test list should be something like 
['N_state_model.test_stereochem_analysis'].  The first part is the imported 
test case class, the second is the specific test.
 
 
-        @keyword tests: The list of system tests to preform.
-        @type tests:    list of str
+        @keyword tests:     The list of system tests to preform.
+        @type tests:        list of str
+        @keyword runner:    A test runner such as TextTestRunner.  For an 
example of how to write a test runner see the python documentation for 
TextTestRunner in the python source.
+        @type runner:       Test runner instance (TextTestRunner, 
BaseGUITestRunner subclass, etc.)
         """
 
         # Create an array of test suites (add your new TestCase classes 
here).
@@ -159,7 +158,7 @@
         full_suite = TestSuite(suite_array)
 
         # Run the test suite.
-        results = RelaxTestRunner().run(full_suite)
+        results = runner.run(full_suite)
 
         # Return the status of the tests.
         return results.wasSuccessful()

Modified: 1.3/test_suite/test_suite_runner.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/test_suite/test_suite_runner.py?rev=14787&r1=14786&r2=14787&view=diff
==============================================================================
--- 1.3/test_suite/test_suite_runner.py (original)
+++ 1.3/test_suite/test_suite_runner.py Wed Oct  5 15:10:42 2011
@@ -66,6 +66,9 @@
         # A list for skipped tests.
         status.skip = []
 
+        # Set up the test runner.
+        self.runner = RelaxTestRunner(stream=sys.stdout)
+
 
     def run_all_tests(self):
         """Execute all of the test suite test types."""
@@ -97,7 +100,7 @@
         # Run the tests.
         if dep_check.wx_module:
             gui_runner = GUI_test_runner()
-            self.gui_result = gui_runner.run(self.tests)
+            self.gui_result = gui_runner.run(self.tests, runner=self.runner)
 
         # No wx module installed.
         else:
@@ -121,7 +124,7 @@
 
         # Run the tests.
         system_runner = System_test_runner()
-        self.system_result = system_runner.run(self.tests)
+        self.system_result = system_runner.run(self.tests, 
runner=self.runner)
 
         # Print out a summary of the test suite.
         if summary:
@@ -140,7 +143,7 @@
 
         # Run the tests.
         unit_runner = 
Unit_test_runner(root_path=status.install_path+os.sep+'test_suite'+os.sep+'unit_tests')
-        self.unit_result = 
unit_runner.run(runner=RelaxTestRunner(stream=sys.stdout))
+        self.unit_result = unit_runner.run(runner=self.runner)
 
         # Print out a summary of the test suite.
         if summary:




Related Messages


Powered by MHonArc, Updated Wed Oct 05 15:40:02 2011