Author: bugman Date: Fri Apr 20 22:41:12 2012 New Revision: 15787 URL: http://svn.gna.org/viewcvs/relax?rev=15787&view=rev Log: The 'Tools->Test suite' menu item has been converted into a sub-menu. Now there are entries for running all tests, or the individual categories. Modified: 1.3/gui/menu.py 1.3/gui/relax_gui.py Modified: 1.3/gui/menu.py URL: http://svn.gna.org/viewcvs/relax/1.3/gui/menu.py?rev=15787&r1=15786&r2=15787&view=diff ============================================================================== --- 1.3/gui/menu.py (original) +++ 1.3/gui/menu.py Fri Apr 20 22:41:12 2012 @@ -54,6 +54,10 @@ MENU_VIEW_PROMPT = wx.NewId() MENU_TOOLS_FORMAT = wx.NewId() MENU_TOOLS_TEST_SUITE = wx.NewId() + MENU_TOOLS_TEST_SUITE_ALL = wx.NewId() + MENU_TOOLS_TEST_SUITE_SYS = wx.NewId() + MENU_TOOLS_TEST_SUITE_UNIT = wx.NewId() + MENU_TOOLS_TEST_SUITE_GUI = wx.NewId() MENU_TOOLS_SYS_INFO = wx.NewId() MENU_HELP_MANUAL = wx.NewId() MENU_HELP_MAIL = wx.NewId() @@ -116,13 +120,25 @@ menu = wx.Menu() menu.AppendItem(build_menu_item(menu, id=self.MENU_TOOLS_FORMAT, text="&Free file format settings", icon=paths.icon_16x16.document_properties)) menu.AppendItem(build_menu_item(menu, id=self.MENU_TOOLS_SYS_INFO, text="System &information", icon=paths.icon_16x16.help_about)) - menu.AppendItem(build_menu_item(menu, id=self.MENU_TOOLS_TEST_SUITE, text="&Test suite", icon=paths.icon_16x16.uf_script)) + + # The 'Tools->Test suite" sub-menu. + test_suite_item = build_menu_item(menu, id=self.MENU_TOOLS_TEST_SUITE, text="&Test suite", icon=paths.icon_16x16.uf_script) + sub_menu = wx.Menu() + test_suite_item.SetSubMenu(sub_menu) + sub_menu.AppendItem(build_menu_item(sub_menu, id=self.MENU_TOOLS_TEST_SUITE_ALL, text="&All tests", icon=paths.icon_16x16.uf_script)) + sub_menu.AppendItem(build_menu_item(sub_menu, id=self.MENU_TOOLS_TEST_SUITE_SYS, text="&System tests", icon=paths.icon_16x16.uf_script)) + sub_menu.AppendItem(build_menu_item(sub_menu, id=self.MENU_TOOLS_TEST_SUITE_UNIT, text="&Unit tests", icon=paths.icon_16x16.uf_script)) + sub_menu.AppendItem(build_menu_item(sub_menu, id=self.MENU_TOOLS_TEST_SUITE_GUI, text="&GUI tests", icon=paths.icon_16x16.uf_script)) + menu.AppendItem(test_suite_item) self.menubar.Append(menu, "&Tools") # The 'Tools' menu actions. self.gui.Bind(wx.EVT_MENU, self.gui.free_file_format_settings, id=self.MENU_TOOLS_FORMAT) self.gui.Bind(wx.EVT_MENU, self._sys_info, id=self.MENU_TOOLS_SYS_INFO) - self.gui.Bind(wx.EVT_MENU, self.gui.run_test_suite, id=self.MENU_TOOLS_TEST_SUITE) + self.gui.Bind(wx.EVT_MENU, self.gui.run_test_suite, id=self.MENU_TOOLS_TEST_SUITE_ALL) + self.gui.Bind(wx.EVT_MENU, self.gui.run_test_suite_sys, id=self.MENU_TOOLS_TEST_SUITE_SYS) + self.gui.Bind(wx.EVT_MENU, self.gui.run_test_suite_unit, id=self.MENU_TOOLS_TEST_SUITE_UNIT) + self.gui.Bind(wx.EVT_MENU, self.gui.run_test_suite_gui, id=self.MENU_TOOLS_TEST_SUITE_GUI) # The 'Help' menu entries. menu = wx.Menu() Modified: 1.3/gui/relax_gui.py URL: http://svn.gna.org/viewcvs/relax/1.3/gui/relax_gui.py?rev=15787&r1=15786&r2=15787&view=diff ============================================================================== --- 1.3/gui/relax_gui.py (original) +++ 1.3/gui/relax_gui.py Fri Apr 20 22:41:12 2012 @@ -48,6 +48,7 @@ from relax_errors import RelaxError from relax_io import io_streams_restore from status import Status; status = Status() +import test_suite.test_suite_runner from version import version # relaxGUI module imports. @@ -70,7 +71,6 @@ from gui.results_viewer import Results_viewer from gui.settings import Free_file_format, load_sequence from gui.user_functions import User_functions; user_functions = User_functions() -import test_suite class Main(wx.Frame): @@ -436,11 +436,13 @@ open_file(file) - def run_test_suite(self, event): + def run_test_suite(self, event, categories=['system', 'unit', 'gui']): """Execute the full test suite. - @param event: The wx event. - @type event: wx event + @param event: The wx event. + @type event: wx event + @keyword categories: The list of test categories to run, for example ['system', 'unit', 'gui'] for all tests. + @type categories: list of str """ # Ask if this should be done. @@ -464,7 +466,7 @@ status.show_gui = False # Run the tests. - runner = test_suite.test_suite_runner.Test_suite_runner([], from_gui=True) + runner = test_suite.test_suite_runner.Test_suite_runner([], from_gui=True, categories=categories) runner.run_all_tests() # Reactive the GUI. @@ -473,6 +475,39 @@ # Turn off the busy cursor. if wx.IsBusy(): wx.EndBusyCursor() + + + def run_test_suite_gui(self, event): + """Execute the GUI tests. + + @param event: The wx event. + @type event: wx event + """ + + # Forward the call. + self.run_test_suite(event, categories=['gui']) + + + def run_test_suite_sys(self, event): + """Execute the system tests. + + @param event: The wx event. + @type event: wx event + """ + + # Forward the call. + self.run_test_suite(event, categories=['system']) + + + def run_test_suite_unit(self, event): + """Execute the unit tests. + + @param event: The wx event. + @type event: wx event + """ + + # Forward the call. + self.run_test_suite(event, categories=['unit']) def show_controller(self, event):