mailr4354 - in /1.3: relax test_suite/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 January 05, 2008 - 18:41:
Author: bugman
Date: Sat Jan  5 18:41:07 2008
New Revision: 4354

URL: http://svn.gna.org/viewcvs/relax?rev=4354&view=rev
Log:
Split the Test_suite_runner.__init__() method into many smaller methods.

This is part of a clean up of the messy base structure of the relax test 
suite.


Modified:
    1.3/relax
    1.3/test_suite/test_suite_runner.py

Modified: 1.3/relax
URL: 
http://svn.gna.org/viewcvs/relax/1.3/relax?rev=4354&r1=4353&r2=4354&view=diff
==============================================================================
--- 1.3/relax (original)
+++ 1.3/relax Sat Jan  5 18:41:07 2008
@@ -178,7 +178,8 @@
             self.interpreter._on()
 
             # Run the tests.
-            Test_suite_runner(self)
+            runner = Test_suite_runner(self)
+            runner.run_all_tests()
 
         # Execute the relax system tests.
         elif mode == 'system tests':

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=4354&r1=4353&r2=4354&view=diff
==============================================================================
--- 1.3/test_suite/test_suite_runner.py (original)
+++ 1.3/test_suite/test_suite_runner.py Sat Jan  5 18:41:07 2008
@@ -1,6 +1,6 @@
 
###############################################################################
 #                                                                            
 #
-# Copyright (C) 2006 Edward d'Auvergne                                       
 #
+# Copyright (C) 2006-2008 Edward d'Auvergne                                  
 #
 #                                                                            
 #
 # This file is part of the program relax.                                    
 #
 #                                                                            
 #
@@ -21,7 +21,7 @@
 
###############################################################################
 
 # Formatting.
-from formatting import *
+from formatting import heading, summary_line
 
 # Import the test suite categories.
 from system_tests.main import System_tests
@@ -49,20 +49,58 @@
 
         self.relax = relax
 
+
+    def run_all_tests(self):
+        """Execute all of the test suite test types."""
+
         # Execute the old system/functional tests.
-        sys_runner = System_tests(self.relax)
-        system_result_old = sys_runner.run()
+        self.run_old_system_tests()
 
         # Execute the system/functional tests.
-        system_runner = System_test_runner(self.relax)
-        system_result = system_runner.run()
+        self.run_system_tests()
 
         # Execute the unit tests.
-        unit_runner = Unit_test_runner(root_path='test_suite/unit_tests')
-        unit_result = unit_runner.run(runner=RelaxTestRunner())
+        self.run_unit_tests()
 
         # Print out a summary of the test suite.
-        ########################################
+        self.summary()
+
+
+    def run_old_system_tests(self):
+        """Function for executing the old style system/functional tests."""
+
+        # Print a header.
+        heading('Old system / functional tests')
+
+        # Run the tests.
+        sys_runner = System_tests(self.relax)
+        self.system_result_old = sys_runner.run()
+
+
+    def run_system_tests(self):
+        """Function for executing the system/functional tests."""
+
+        # Print a header.
+        heading('System / functional tests')
+
+        # Run the tests.
+        system_runner = System_test_runner(self.relax)
+        self.system_result = system_runner.run()
+
+
+    def run_unit_tests(self):
+        """Function for executing the unit tests."""
+
+        # Print a header.
+        heading('Unit tests')
+
+        # Run the tests.
+        unit_runner = Unit_test_runner(root_path='test_suite/unit_tests')
+        self.unit_result = unit_runner.run(runner=RelaxTestRunner())
+
+
+    def summary(self):
+        """Print out a summary of the relax test suite."""
 
         # Heading.
         print "\n\n\n"
@@ -71,13 +109,13 @@
         print "###################################\n"
 
         # Old system/functional test summary.
-        summary_line("Old system/functional tests", system_result_old)
+        summary_line("Old system/functional tests", self.system_result_old)
 
         # System/functional test summary.
-        summary_line("System/functional tests", system_result)
+        summary_line("System/functional tests", self.system_result)
 
         # Unit test summary.
-        summary_line("Unit tests", unit_result)
+        summary_line("Unit tests", self.unit_result)
 
         # Synopsis.
-        summary_line("Synopsis", system_result and unit_result)
+        summary_line("Synopsis", self.system_result_old and 
self.system_result and self.unit_result)




Related Messages


Powered by MHonArc, Updated Sat Jan 05 19:00:19 2008