def workflow(): _ = yield hook("gps_started") yield timeout(10) last_result = None try: action_gen = action_fn() if action_gen is not None: last_result = yield action_gen except Exception: import traceback GPS.Logger('TESTSUITE').log( "Driver workflow received an exception %s %s\n%s" % (sys.exc_info()[0], sys.exc_info()[1], traceback.format_exc())) finally: if "GPS_PREVENT_EXIT" not in os.environ: if last_result in (SUCCESS, FAILURE, NOT_RUN, XFAIL): status = last_result else: status = 0 # In case there was an error in an assert, record the contents # of the console to aid post-mortem investigations if get_exit_status() != SUCCESS: msg = "Exiting with the following in the Console:\n{}".format( GPS.Console().get_text()) GPS.Logger('TESTSUITE').log(msg) GPS.exit(force=True, status=status)
def workflow(): _ = yield hook("gps_started") yield timeout(10) last_result = None try: action_gen = action_fn() if action_gen is not None: last_result = yield action_gen except Exception: import traceback GPS.Logger('TESTSUITE').log( "Driver workflow received an exception %s %s\n%s" % (sys.exc_info()[0], sys.exc_info()[1], traceback.format_exc())) finally: if "GPS_PREVENT_EXIT" not in os.environ: if last_result in (SUCCESS, FAILURE, NOT_RUN, XFAIL): status = last_result else: status = 0 GPS.exit(force=True, status=status)
def stage(self, files): """ Stage one or more files for commit, by clicking in the tree :param [GPS.File] files: """ for f in files: select_in_tree(self.tree, column=Commits.COLUMN_FILE, key=f) GPS.execute_action("vcs toggle stage selected files") yield hook("vcs_file_status_finished")
def driver(): GPS.Preference("General-Charset").set("UTF-8") b = GPS.EditorBuffer.get(GPS.File("hello.adb")) b.find_all_refs(b.at(2, 15), True) yield hook('language_server_response_processed') actual = b.debug_dump_syntax_highlighting("Search results") gps_assert( actual.strip(), expected.strip(), "highlighting is wrong after find all refs:\n" + "\n%s\n!=\n%s\n" % (actual, expected))
def driver(): GPS.Preference("General-Charset").set("UTF-8") b = GPS.EditorBuffer.get(GPS.File("hello.adb")) # wait LSP responses has been processed to have folding information if GPS.LanguageServer.is_enabled_for_language_name("Ada"): yield wait_tasks(other_than=known_tasks) b.find_all_refs(b.at(2, 15), True) yield hook('language_server_response_processed') actual = b.debug_dump_syntax_highlighting("Search results") gps_assert( actual.strip(), expected.strip(), "highlighting is wrong after find all refs:\n" + "\n%s\n!=\n%s\n" % (actual, expected))
def workflow(): _ = yield hook("gps_started") yield timeout(10) try: action_gen = action_fn() if action_gen is not None: yield action_gen except: import traceback GPS.Logger('TESTSUITE').log( "Driver workflow received an exception %s %s\n%s" % (sys.exc_info()[0], sys.exc_info()[1], traceback.format_exc())) finally: if "GPS_PREVENT_EXIT" not in os.environ: GPS.exit(force=True)
def ok(self): get_stock_button(self.dialogs, Gtk.STOCK_OK).clicked() yield hook('debuggee_started')
def stage_via_name(self, names): for name in names: select_in_tree(self.tree, column=Commits.COLUMN_NAME, key=name) GPS.execute_action("vcs toggle stage selected files") yield hook("vcs_file_status_finished")