Author: bugman Date: Tue Oct 6 20:34:18 2015 New Revision: 28010 URL: http://svn.gna.org/viewcvs/relax?rev=28010&view=rev Log: Cosmetic bug fix for the running of the test suite in the GUI. The list of skipped tests in the status object was not being reinitialised for each run of the test suite. This only affects the GUI where the tests can be run multiple times. The result was that the list of skipped tests was always being printed out, even if no tests were skipped. Modified: trunk/test_suite/gui_tests/base_classes.py trunk/test_suite/test_suite_runner.py Modified: trunk/test_suite/gui_tests/base_classes.py URL: http://svn.gna.org/viewcvs/relax/trunk/test_suite/gui_tests/base_classes.py?rev=28010&r1=28009&r2=28010&view=diff ============================================================================== --- trunk/test_suite/gui_tests/base_classes.py (original) +++ trunk/test_suite/gui_tests/base_classes.py Tue Oct 6 20:34:18 2015 @@ -36,7 +36,7 @@ from gui.string_conv import str_to_gui from gui.uf_objects import Uf_storage; uf_store = Uf_storage() from gui.wizards.wiz_objects import Wiz_window -from lib.compat import queue +from lib.compat import SYSTEM, queue from lib.errors import RelaxError from pipe_control.reset import reset from prompt.interpreter import exec_script @@ -309,22 +309,23 @@ self.clean_up_windows() # Print out a list of all living windows to help ensure that custom Close() and Destroy() methods are cleaning up all objects. - print("\n\nList of all living GUI elements - this must only include the main GUI window and the relax controller:") - all_destroyed = True - for window in wx.GetTopLevelWindows(): - # Printout. - print(" Window: %s" % window) - if isinstance(window, Wiz_window): - print(" Wizard title: %s" % window.title) - print(" Wizard pages: %s" % window._pages) - - # Skip the main GUI window and the relax controller. - if isinstance(window, Main) or isinstance(window, Controller): - continue - - # Failure of memory management. - all_destroyed = False - print("\n\n\n") + if SYSTEM != 'Darwin': + print("\n\nList of all living GUI elements - this must only include the main GUI window and the relax controller:") + all_destroyed = True + for window in wx.GetTopLevelWindows(): + # Printout. + print(" Window: %s" % window) + if isinstance(window, Wiz_window): + print(" Wizard title: %s" % window.title) + print(" Wizard pages: %s" % window._pages) + + # Skip the main GUI window and the relax controller. + if isinstance(window, Main) or isinstance(window, Controller): + continue + + # Failure of memory management. + all_destroyed = False + print("\n\n\n") # Memory management check. #if not all_destroyed: Modified: trunk/test_suite/test_suite_runner.py URL: http://svn.gna.org/viewcvs/relax/trunk/test_suite/test_suite_runner.py?rev=28010&r1=28009&r2=28010&view=diff ============================================================================== --- trunk/test_suite/test_suite_runner.py (original) +++ trunk/test_suite/test_suite_runner.py Tue Oct 6 20:34:18 2015 @@ -1,6 +1,6 @@ ############################################################################### # # -# Copyright (C) 2006-2014 Edward d'Auvergne # +# Copyright (C) 2006-2015 Edward d'Auvergne # # # # This file is part of the program relax (http://www.nmr-relax.com). # # # @@ -79,9 +79,6 @@ self.from_gui = from_gui self.categories = categories - # A list for skipped tests. - status.skip = [] - # Set up the test runner. if from_gui: self.runner = GuiTestRunner(stream=sys.stdout, timing=timing) @@ -93,31 +90,39 @@ unittest.installHandler() - def run_all_tests(self): - """Execute all of the test suite test types.""" + def run_all_tests(self, reset=True): + """Execute all of the test suite test types. + + @keyword reset: A flag which if True will reset the relax status objects for the tests. + @type reset: bool + """ + + # Reset the list for skipped tests. + if reset: + status.skipped_tests = [] # Execute the system/functional tests. if 'system' in self.categories: - status = self.run_system_tests(summary=False) - if not status: + test_status = self.run_system_tests(summary=False, reset=False) + if not test_status: return # Execute the unit tests. if 'unit' in self.categories: - status = self.run_unit_tests(summary=False) - if not status: + test_status = self.run_unit_tests(summary=False, reset=False) + if not test_status: return # Execute the GUI tests. if 'gui' in self.categories: - status = self.run_gui_tests(summary=False) - if not status: + test_status = self.run_gui_tests(summary=False, reset=False) + if not test_status: return # Execute the GUI tests. if 'verification' in self.categories: - status = self.run_verification_tests(summary=False) - if not status: + test_status = self.run_verification_tests(summary=False, reset=False) + if not test_status: return # Print out a summary of the test suite. @@ -125,14 +130,20 @@ - def run_gui_tests(self, summary=True): + def run_gui_tests(self, summary=True, reset=True): """Execute the GUI tests. @keyword summary: A flag which if True will cause a summary to be printed. @type summary: bool + @keyword reset: A flag which if True will reset the relax status objects for the tests. + @type reset: bool @return: True if the tests were run, False if a KeyboardInterrupt occurred. @rtype: bool """ + + # Reset the list for skipped tests. + if reset: + status.skipped_tests = [] # Run the tests, catching the keyboard interrupt. try: @@ -182,14 +193,20 @@ return True - def run_system_tests(self, summary=True): + def run_system_tests(self, summary=True, reset=True): """Execute the system/functional tests. @keyword summary: A flag which if True will cause a summary to be printed. @type summary: bool + @keyword reset: A flag which if True will reset the relax status objects for the tests. + @type reset: bool @return: True if the tests were run, False if a KeyboardInterrupt occurred. @rtype: bool """ + + # Reset the list for skipped tests. + if reset: + status.skipped_tests = [] # Run the tests, catching the keyboard interrupt. try: @@ -214,14 +231,20 @@ return True - def run_unit_tests(self, summary=True): + def run_unit_tests(self, summary=True, reset=True): """Execute the unit tests. @keyword summary: A flag which if True will cause a summary to be printed. @type summary: bool + @keyword reset: A flag which if True will reset the relax status objects for the tests. + @type reset: bool @return: True if the tests were run, False if a KeyboardInterrupt occurred. @rtype: bool """ + + # Reset the list for skipped tests. + if reset: + status.skipped_tests = [] # Run the tests, catching the keyboard interrupt. try: @@ -246,12 +269,18 @@ return True - def run_verification_tests(self, summary=True): + def run_verification_tests(self, summary=True, reset=True): """Execute the software verification tests. @keyword summary: A flag which if True will cause a summary to be printed. @type summary: bool - """ + @keyword reset: A flag which if True will reset the relax status objects for the tests. + @type reset: bool + """ + + # Reset the list for skipped tests. + if reset: + status.skipped_tests = [] # Run the tests, catching the keyboard interrupt. try: