Author: bugman Date: Tue Aug 9 23:49:01 2011 New Revision: 14305 URL: http://svn.gna.org/viewcvs/relax?rev=14305&view=rev Log: The GUI tests are now skipped when the wx module is not present (or is broken). This allows relax to operate without having wx installed. Modified: branches/gui_testing/test_suite/formatting.py branches/gui_testing/test_suite/test_suite_runner.py Modified: branches/gui_testing/test_suite/formatting.py URL: http://svn.gna.org/viewcvs/relax/branches/gui_testing/test_suite/formatting.py?rev=14305&r1=14304&r2=14305&view=diff ============================================================================== --- branches/gui_testing/test_suite/formatting.py (original) +++ branches/gui_testing/test_suite/formatting.py Tue Aug 9 23:49:01 2011 @@ -49,8 +49,8 @@ @param name: The name of the test, test category, etc. @type name: str - @param passed: An argument which if True causes '[ OK ]' to be printed and if False causes '[ Failed ]' to be printed. - @type passed: bool + @param passed: An argument which if True causes '[ OK ]' to be printed and if False causes '[ Failed ]' to be printed. The special string 'skip' is used to indicate that this has been skipped. + @type passed: bool or str @keyword width: The width of the line, excluding the terminal '[ OK ]' or '[ Failed ]'. @type width: int """ @@ -63,8 +63,12 @@ sys.stdout.write(".") # Passed. - if passed: + if passed == True: sys.stdout.write(" %-10s\n" % "[ OK ]") + + # Skipped. + elif passed == 'skip': + sys.stdout.write(" %-10s\n" % "[ Skipped ]") # Failed. else: Modified: branches/gui_testing/test_suite/test_suite_runner.py URL: http://svn.gna.org/viewcvs/relax/branches/gui_testing/test_suite/test_suite_runner.py?rev=14305&r1=14304&r2=14305&view=diff ============================================================================== --- branches/gui_testing/test_suite/test_suite_runner.py (original) +++ branches/gui_testing/test_suite/test_suite_runner.py Tue Aug 9 23:49:01 2011 @@ -24,11 +24,15 @@ import os import sys +# Dependency checks. +import dep_check + # Formatting. from formatting import subtitle, summary_line, title # Import the test suite categories. -from gui_tests import GUI_test_runner +if dep_check.wx_module: + from gui_tests import GUI_test_runner from system_tests import System_test_runner from unit_tests.unit_test_runner import Unit_test_runner @@ -91,8 +95,14 @@ title('GUI tests') # Run the tests. - gui_runner = GUI_test_runner() - self.gui_result = gui_runner.run(self.tests) + if dep_check.wx_module: + gui_runner = GUI_test_runner() + self.gui_result = gui_runner.run(self.tests) + + # No wx module installed. + else: + print("All GUI tests skipped due to the missing/broken wx module.\n") + self.gui_result = 'skip' # Print out a summary of the test suite. if summary: