Author: bugman Date: Wed Oct 5 14:11:21 2011 New Revision: 14784 URL: http://svn.gna.org/viewcvs/relax?rev=14784&view=rev Log: Started to implement the ability to run the test suite from within the GUI. This still needs a lot of work, as the GUI is frozen the entire time and the results are printed to the terminal rather than the relax controller. Modified: 1.3/gui/relax_gui.py Modified: 1.3/gui/relax_gui.py URL: http://svn.gna.org/viewcvs/relax/1.3/gui/relax_gui.py?rev=14784&r1=14783&r2=14784&view=diff ============================================================================== --- 1.3/gui/relax_gui.py (original) +++ 1.3/gui/relax_gui.py Wed Oct 5 14:11:21 2011 @@ -30,6 +30,7 @@ import platform import sys from textwrap import wrap +from thread import start_new_thread from time import sleep import webbrowser import wx @@ -67,6 +68,7 @@ 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): @@ -415,6 +417,42 @@ open_file(file) + def run_test_suite(self, event): + """Execute the full test suite. + + @param event: The wx event. + @type event: wx event + """ + + # Ask if this should be done. + msg = "In running the test suite, relax will be reset and all data lost. Are you sure you would like to run the test suite?" + if Question(msg, parent=self, default=False).ShowModal() == wx.ID_NO: + return + + # Change the cursor to waiting. + wx.BeginBusyCursor() + + # Reset relax. + reset() + + # Show the relax controller. + self.show_controller(event) + + # Prevent all new GUI elements from being shown. + status.show_gui = False + + # Run the tests. + runner = test_suite.test_suite_runner.Test_suite_runner([]) + runner.run_all_tests() + + # Reactive the GUI. + status.show_gui = True + + # Turn off the busy cursor. + if wx.IsBusy(): + wx.EndBusyCursor() + + def show_controller(self, event): """Display the relax controller window.