33 |
34 |
34 class DebugServer(QTcpServer): |
35 class DebugServer(QTcpServer): |
35 """ |
36 """ |
36 Class implementing the debug server embedded within the IDE. |
37 Class implementing the debug server embedded within the IDE. |
37 |
38 |
38 @signal clientProcessStdout(str) emitted after the client has sent some output |
39 @signal clientProcessStdout(str) emitted after the client has sent some |
39 via stdout |
40 output via stdout |
40 @signal clientProcessStderr(str) emitted after the client has sent some output |
41 @signal clientProcessStderr(str) emitted after the client has sent some |
41 via stderr |
42 output via stderr |
42 @signal clientOutput(str) emitted after the client has sent some output |
43 @signal clientOutput(str) emitted after the client has sent some output |
43 @signal clientRawInputSent() emitted after the data was sent to the debug client |
44 @signal clientRawInputSent() emitted after the data was sent to the |
44 @signal clientLine(filename, lineno, forStack) emitted after the debug client |
45 debug client |
45 has executed a line of code |
46 @signal clientLine(filename, lineno, forStack) emitted after the |
|
47 debug client has executed a line of code |
46 @signal clientStack(stack) emitted after the debug client has executed a |
48 @signal clientStack(stack) emitted after the debug client has executed a |
47 line of code |
49 line of code |
48 @signal clientThreadList(currentId, threadList) emitted after a thread list |
50 @signal clientThreadList(currentId, threadList) emitted after a thread list |
49 has been received |
51 has been received |
50 @signal clientThreadSet() emitted after the client has acknowledged the change |
52 @signal clientThreadSet() emitted after the client has acknowledged the |
51 of the current thread |
53 change of the current thread |
52 @signal clientVariables(scope, variables) emitted after a variables dump has |
54 @signal clientVariables(scope, variables) emitted after a variables dump |
53 been received |
55 has been received |
54 @signal clientVariable(scope, variables) emitted after a dump for one class |
56 @signal clientVariable(scope, variables) emitted after a dump for one class |
55 variable has been received |
57 variable has been received |
56 @signal clientStatement(bool) emitted after an interactive command has |
58 @signal clientStatement(bool) emitted after an interactive command has |
57 been executed. The parameter is 0 to indicate that the command is |
59 been executed. The parameter is 0 to indicate that the command is |
58 complete and 1 if it needs more input. |
60 complete and 1 if it needs more input. |
59 @signal clientException(exception) emitted after an exception occured on the |
61 @signal clientException(exception) emitted after an exception occured on |
60 client side |
62 the client side |
61 @signal clientSyntaxError(exception) emitted after a syntax error has been detected |
63 @signal clientSyntaxError(exception) emitted after a syntax error has been |
62 on the client side |
64 detected on the client side |
63 @signal clientExit(int) emitted with the exit status after the client has exited |
65 @signal clientExit(int) emitted with the exit status after the client has |
|
66 exited |
64 @signal clientClearBreak(filename, lineno) emitted after the debug client |
67 @signal clientClearBreak(filename, lineno) emitted after the debug client |
65 has decided to clear a temporary breakpoint |
68 has decided to clear a temporary breakpoint |
66 @signal clientBreakConditionError(fn, lineno) emitted after the client has signaled |
69 @signal clientBreakConditionError(fn, lineno) emitted after the client has |
67 a syntax error in a breakpoint condition |
70 signaled a syntax error in a breakpoint condition |
68 @signal clientClearWatch(condition) emitted after the debug client |
71 @signal clientClearWatch(condition) emitted after the debug client |
69 has decided to clear a temporary watch expression |
72 has decided to clear a temporary watch expression |
70 @signal clientWatchConditionError(condition) emitted after the client has signaled |
73 @signal clientWatchConditionError(condition) emitted after the client has |
71 a syntax error in a watch expression |
74 signaled a syntax error in a watch expression |
72 @signal clientRawInput(prompt, echo) emitted after a raw input request was received |
75 @signal clientRawInput(prompt, echo) emitted after a raw input request was |
|
76 received |
73 @signal clientBanner(banner) emitted after the client banner was received |
77 @signal clientBanner(banner) emitted after the client banner was received |
74 @signal clientCapabilities(int capabilities, string cltype) emitted after the clients |
78 @signal clientCapabilities(int capabilities, string cltype) emitted after |
75 capabilities were received |
79 the clients capabilities were received |
76 @signal clientCompletionList(completionList, text) emitted after the client |
80 @signal clientCompletionList(completionList, text) emitted after the client |
77 the commandline completion list and the reworked searchstring was |
81 the commandline completion list and the reworked searchstring was |
78 received from the client |
82 received from the client |
79 @signal passiveDebugStarted(str, bool) emitted after the debug client has connected in |
83 @signal passiveDebugStarted(str, bool) emitted after the debug client has |
80 passive debug mode |
84 connected in passive debug mode |
81 @signal clientGone(bool) emitted if the client went away (planned or unplanned) |
85 @signal clientGone(bool) emitted if the client went away (planned or |
82 @signal utPrepared(nrTests, exc_type, exc_value) emitted after the client has |
86 unplanned) |
83 loaded a unittest suite |
87 @signal utPrepared(nrTests, exc_type, exc_value) emitted after the client |
84 @signal utFinished() emitted after the client signalled the end of the unittest |
88 has loaded a unittest suite |
85 @signal utStartTest(testname, testdocu) emitted after the client has started |
89 @signal utFinished() emitted after the client signalled the end of the |
86 a test |
90 unittest |
|
91 @signal utStartTest(testname, testdocu) emitted after the client has |
|
92 started a test |
87 @signal utStopTest() emitted after the client has finished a test |
93 @signal utStopTest() emitted after the client has finished a test |
88 @signal utTestFailed(testname, exc_info, id) emitted after the client reported |
94 @signal utTestFailed(testname, exc_info, id) emitted after the client |
89 a failed test |
95 reported a failed test |
90 @signal utTestErrored(testname, exc_info, id) emitted after the client reported |
96 @signal utTestErrored(testname, exc_info, id) emitted after the client |
91 an errored test |
97 reported an errored test |
92 @signal utTestSkipped(testname, reason, id) emitted after the client reported |
98 @signal utTestSkipped(testname, reason, id) emitted after the client |
93 a skipped test |
99 reported a skipped test |
94 @signal utTestFailedExpected(testname, exc_info, id) emitted after the client reported |
100 @signal utTestFailedExpected(testname, exc_info, id) emitted after the |
95 an expected test failure |
101 client reported an expected test failure |
96 @signal utTestSucceededUnexpected(testname, id) emitted after the client reported |
102 @signal utTestSucceededUnexpected(testname, id) emitted after the client |
97 an unexpected test success |
103 reported an unexpected test success |
98 @signal callTraceInfo(isCall, fromFile, fromLine, fromFunction, toFile, toLine, toFunction) |
104 @signal callTraceInfo(isCall, fromFile, fromLine, fromFunction, toFile, |
99 emitted after the client reported the call trace data |
105 toLine, toFunction) emitted after the client reported the call trace |
|
106 data |
100 """ |
107 """ |
101 clientClearBreak = pyqtSignal(str, int) |
108 clientClearBreak = pyqtSignal(str, int) |
102 clientClearWatch = pyqtSignal(str) |
109 clientClearWatch = pyqtSignal(str) |
103 clientGone = pyqtSignal(bool) |
110 clientGone = pyqtSignal(bool) |
104 clientProcessStdout = pyqtSignal(str) |
111 clientProcessStdout = pyqtSignal(str) |
179 |
186 |
180 self.clientClearBreak.connect(self.__clientClearBreakPoint) |
187 self.clientClearBreak.connect(self.__clientClearBreakPoint) |
181 self.clientClearWatch.connect(self.__clientClearWatchPoint) |
188 self.clientClearWatch.connect(self.__clientClearWatchPoint) |
182 self.newConnection[()].connect(self.__newConnection) |
189 self.newConnection[()].connect(self.__newConnection) |
183 |
190 |
184 self.breakpointModel.rowsAboutToBeRemoved.connect(self.__deleteBreakPoints) |
191 self.breakpointModel.rowsAboutToBeRemoved.connect( |
|
192 self.__deleteBreakPoints) |
185 self.breakpointModel.dataAboutToBeChanged.connect( |
193 self.breakpointModel.dataAboutToBeChanged.connect( |
186 self.__breakPointDataAboutToBeChanged) |
194 self.__breakPointDataAboutToBeChanged) |
187 self.breakpointModel.dataChanged.connect(self.__changeBreakPoints) |
195 self.breakpointModel.dataChanged.connect(self.__changeBreakPoints) |
188 self.breakpointModel.rowsInserted.connect(self.__addBreakPoints) |
196 self.breakpointModel.rowsInserted.connect(self.__addBreakPoints) |
189 |
197 |
190 self.watchpointModel.rowsAboutToBeRemoved.connect(self.__deleteWatchPoints) |
198 self.watchpointModel.rowsAboutToBeRemoved.connect( |
|
199 self.__deleteWatchPoints) |
191 self.watchpointModel.dataAboutToBeChanged.connect( |
200 self.watchpointModel.dataAboutToBeChanged.connect( |
192 self.__watchPointDataAboutToBeChanged) |
201 self.__watchPointDataAboutToBeChanged) |
193 self.watchpointModel.dataChanged.connect(self.__changeWatchPoints) |
202 self.watchpointModel.dataChanged.connect(self.__changeWatchPoints) |
194 self.watchpointModel.rowsInserted.connect(self.__addWatchPoints) |
203 self.watchpointModel.rowsInserted.connect(self.__addWatchPoints) |
195 |
204 |
196 self.__registerDebuggerInterfaces() |
205 self.__registerDebuggerInterfaces() |
197 |
206 |
198 def getHostAddress(self, localhost): |
207 def getHostAddress(self, localhost): |
199 """ |
208 """ |
200 Public method to get the IP address or hostname the debug server is listening. |
209 Public method to get the IP address or hostname the debug server is |
201 |
210 listening. |
202 @param localhost flag indicating to return the address for localhost (boolean) |
211 |
|
212 @param localhost flag indicating to return the address for localhost |
|
213 (boolean) |
203 @return IP address or hostname (string) |
214 @return IP address or hostname (string) |
204 """ |
215 """ |
205 if self.networkInterface == "all": |
216 if self.networkInterface == "all": |
206 if localhost: |
217 if localhost: |
207 return "127.0.0.1" |
218 return "127.0.0.1" |
216 return "{0}@@i{1}".format(self.networkInterface, |
227 return "{0}@@i{1}".format(self.networkInterface, |
217 self.networkInterfaceIndex) |
228 self.networkInterfaceIndex) |
218 |
229 |
219 def __getNetworkInterfaceAndIndex(self, address): |
230 def __getNetworkInterfaceAndIndex(self, address): |
220 """ |
231 """ |
221 Private method to determine the network interface and the interface index. |
232 Private method to determine the network interface and the interface |
|
233 index. |
222 |
234 |
223 @param address address to determine the info for (string) |
235 @param address address to determine the info for (string) |
224 @return tuple of network interface name (string) and index (integer) |
236 @return tuple of network interface name (string) and index (integer) |
225 """ |
237 """ |
226 if address not in ["all", "allv6"]: |
238 if address not in ["all", "allv6"]: |
227 for networkInterface in QNetworkInterface.allInterfaces(): |
239 for networkInterface in QNetworkInterface.allInterfaces(): |
228 addressEntries = networkInterface.addressEntries() |
240 addressEntries = networkInterface.addressEntries() |
229 if len(addressEntries) > 0: |
241 if len(addressEntries) > 0: |
230 for addressEntry in addressEntries: |
242 for addressEntry in addressEntries: |
231 if addressEntry.ip().toString().lower() == address.lower(): |
243 if addressEntry.ip().toString().lower() == \ |
|
244 address.lower(): |
232 return networkInterface.humanReadableName(), \ |
245 return networkInterface.humanReadableName(), \ |
233 networkInterface.index() |
246 networkInterface.index() |
234 |
247 |
235 return "", 0 |
248 return "", 0 |
236 |
249 |
306 if self.lastClientType != self.clientType or clientType is not None: |
321 if self.lastClientType != self.clientType or clientType is not None: |
307 if clientType is None: |
322 if clientType is None: |
308 clientType = self.clientType |
323 clientType = self.clientType |
309 if clientType == "Python2": |
324 if clientType == "Python2": |
310 from .DebuggerInterfacePython import DebuggerInterfacePython |
325 from .DebuggerInterfacePython import DebuggerInterfacePython |
311 self.debuggerInterface = DebuggerInterfacePython(self, self.passive) |
326 self.debuggerInterface = DebuggerInterfacePython( |
|
327 self, self.passive) |
312 elif clientType == "Python3": |
328 elif clientType == "Python3": |
313 from .DebuggerInterfacePython3 import DebuggerInterfacePython3 |
329 from .DebuggerInterfacePython3 import DebuggerInterfacePython3 |
314 self.debuggerInterface = DebuggerInterfacePython3(self, self.passive) |
330 self.debuggerInterface = DebuggerInterfacePython3( |
|
331 self, self.passive) |
315 elif clientType == "Ruby": |
332 elif clientType == "Ruby": |
316 from .DebuggerInterfaceRuby import DebuggerInterfaceRuby |
333 from .DebuggerInterfaceRuby import DebuggerInterfaceRuby |
317 self.debuggerInterface = DebuggerInterfaceRuby(self, self.passive) |
334 self.debuggerInterface = DebuggerInterfaceRuby( |
|
335 self, self.passive) |
318 elif clientType == "None": |
336 elif clientType == "None": |
319 from .DebuggerInterfaceNone import DebuggerInterfaceNone |
337 from .DebuggerInterfaceNone import DebuggerInterfaceNone |
320 self.debuggerInterface = DebuggerInterfaceNone(self, self.passive) |
338 self.debuggerInterface = DebuggerInterfaceNone( |
|
339 self, self.passive) |
321 else: |
340 else: |
322 from .DebuggerInterfaceNone import DebuggerInterfaceNone |
341 from .DebuggerInterfaceNone import DebuggerInterfaceNone |
323 self.debuggerInterface = DebuggerInterfaceNone(self, self.passive) |
342 self.debuggerInterface = DebuggerInterfaceNone( |
|
343 self, self.passive) |
324 self.clientType = "None" |
344 self.clientType = "None" |
325 |
345 |
326 def __setClientType(self, clType): |
346 def __setClientType(self, clType): |
327 """ |
347 """ |
328 Private method to set the client type. |
348 Private method to set the client type. |
436 @param end end row (integer) |
457 @param end end row (integer) |
437 """ |
458 """ |
438 if self.debugging: |
459 if self.debugging: |
439 for row in range(start, end + 1): |
460 for row in range(start, end + 1): |
440 index = self.breakpointModel.index(row, 0, parentIndex) |
461 index = self.breakpointModel.index(row, 0, parentIndex) |
441 fn, lineno = self.breakpointModel.getBreakPointByIndex(index)[0:2] |
462 fn, lineno = \ |
|
463 self.breakpointModel.getBreakPointByIndex(index)[0:2] |
442 self.remoteBreakpoint(fn, lineno, False) |
464 self.remoteBreakpoint(fn, lineno, False) |
443 |
465 |
444 def __changeBreakPoints(self, startIndex, endIndex): |
466 def __changeBreakPoints(self, startIndex, endIndex): |
445 """ |
467 """ |
446 Private slot to set changed breakpoints. |
468 Private slot to set changed breakpoints. |
447 |
469 |
448 @param startIndex starting index of the change breakpoins (QModelIndex) |
470 @param startIndex starting index of the change breakpoins (QModelIndex) |
449 @param endIndex ending index of the change breakpoins (QModelIndex) |
471 @param endIndex ending index of the change breakpoins (QModelIndex) |
450 """ |
472 """ |
451 if self.debugging: |
473 if self.debugging: |
452 self.__addBreakPoints(QModelIndex(), startIndex.row(), endIndex.row()) |
474 self.__addBreakPoints( |
|
475 QModelIndex(), startIndex.row(), endIndex.row()) |
453 |
476 |
454 def __breakPointDataAboutToBeChanged(self, startIndex, endIndex): |
477 def __breakPointDataAboutToBeChanged(self, startIndex, endIndex): |
455 """ |
478 """ |
456 Private slot to handle the dataAboutToBeChanged signal of the breakpoint model. |
479 Private slot to handle the dataAboutToBeChanged signal of the |
|
480 breakpoint model. |
457 |
481 |
458 @param startIndex start index of the rows to be changed (QModelIndex) |
482 @param startIndex start index of the rows to be changed (QModelIndex) |
459 @param endIndex end index of the rows to be changed (QModelIndex) |
483 @param endIndex end index of the rows to be changed (QModelIndex) |
460 """ |
484 """ |
461 if self.debugging: |
485 if self.debugging: |
462 self.__deleteBreakPoints(QModelIndex(), startIndex.row(), endIndex.row()) |
486 self.__deleteBreakPoints( |
|
487 QModelIndex(), startIndex.row(), endIndex.row()) |
463 |
488 |
464 def __addBreakPoints(self, parentIndex, start, end): |
489 def __addBreakPoints(self, parentIndex, start, end): |
465 """ |
490 """ |
466 Private slot to add breakpoints. |
491 Private slot to add breakpoints. |
467 |
492 |
671 |
702 |
672 @param fn the filename to debug (string) |
703 @param fn the filename to debug (string) |
673 @param argv the commandline arguments to pass to the program (string) |
704 @param argv the commandline arguments to pass to the program (string) |
674 @param wd the working directory for the program (string) |
705 @param wd the working directory for the program (string) |
675 @param env environment settings (string) |
706 @param env environment settings (string) |
676 @keyparam autoClearShell flag indicating, that the interpreter window should |
707 @keyparam autoClearShell flag indicating, that the interpreter window |
677 be cleared (boolean) |
708 should be cleared (boolean) |
678 @keyparam tracePython flag indicating if the Python library should be traced |
709 @keyparam tracePython flag indicating if the Python library should be |
679 as well (boolean) |
710 traced as well (boolean) |
680 @keyparam autoContinue flag indicating, that the debugger should not stop |
711 @keyparam autoContinue flag indicating, that the debugger should not |
681 at the first executable line (boolean) |
712 stop at the first executable line (boolean) |
682 @keyparam forProject flag indicating a project related action (boolean) |
713 @keyparam forProject flag indicating a project related action (boolean) |
683 @keyparam runInConsole flag indicating to start the debugger in a |
714 @keyparam runInConsole flag indicating to start the debugger in a |
684 console window (boolean) |
715 console window (boolean) |
685 @keyparam autoFork flag indicating the automatic fork mode (boolean) |
716 @keyparam autoFork flag indicating the automatic fork mode (boolean) |
686 @keyparam forkChild flag indicating to debug the child after forking (boolean) |
717 @keyparam forkChild flag indicating to debug the child after forking |
|
718 (boolean) |
687 @keyparam clientType client type to be used (string) |
719 @keyparam clientType client type to be used (string) |
688 @keyparam enableCallTrace flag indicating to enable the call trace |
720 @keyparam enableCallTrace flag indicating to enable the call trace |
689 function (boolean) |
721 function (boolean) |
690 """ |
722 """ |
691 self.__autoClearShell = autoClearShell |
723 self.__autoClearShell = autoClearShell |
720 |
754 |
721 @param fn the filename to run (string) |
755 @param fn the filename to run (string) |
722 @param argv the commandline arguments to pass to the program (string) |
756 @param argv the commandline arguments to pass to the program (string) |
723 @param wd the working directory for the program (string) |
757 @param wd the working directory for the program (string) |
724 @param env environment settings (string) |
758 @param env environment settings (string) |
725 @keyparam autoClearShell flag indicating, that the interpreter window should |
759 @keyparam autoClearShell flag indicating, that the interpreter window |
726 be cleared (boolean) |
760 should be cleared (boolean) |
727 @keyparam forProject flag indicating a project related action (boolean) |
761 @keyparam forProject flag indicating a project related action (boolean) |
728 @keyparam runInConsole flag indicating to start the debugger in a |
762 @keyparam runInConsole flag indicating to start the debugger in a |
729 console window (boolean) |
763 console window (boolean) |
730 @keyparam autoFork flag indicating the automatic fork mode (boolean) |
764 @keyparam autoFork flag indicating the automatic fork mode (boolean) |
731 @keyparam forkChild flag indicating to debug the child after forking (boolean) |
765 @keyparam forkChild flag indicating to debug the child after forking |
|
766 (boolean) |
732 @keyparam clientType client type to be used (string) |
767 @keyparam clientType client type to be used (string) |
733 """ |
768 """ |
734 self.__autoClearShell = autoClearShell |
769 self.__autoClearShell = autoClearShell |
735 |
770 |
736 # Restart the client |
771 # Restart the client |
737 try: |
772 try: |
738 if clientType: |
773 if clientType: |
739 self.__setClientType(clientType) |
774 self.__setClientType(clientType) |
740 else: |
775 else: |
741 self.__setClientType(self.__clientAssociations[os.path.splitext(fn)[1]]) |
776 self.__setClientType( |
|
777 self.__clientAssociations[os.path.splitext(fn)[1]]) |
742 except KeyError: |
778 except KeyError: |
743 self.__setClientType('Python3') # assume it is a Python3 file |
779 self.__setClientType('Python3') # assume it is a Python3 file |
744 self.startClient(False, forProject=forProject, runInConsole=runInConsole) |
780 self.startClient(False, forProject=forProject, |
|
781 runInConsole=runInConsole) |
745 |
782 |
746 self.remoteEnvironment(env) |
783 self.remoteEnvironment(env) |
747 |
784 |
748 self.debuggerInterface.remoteRun(fn, argv, wd, autoFork, forkChild) |
785 self.debuggerInterface.remoteRun(fn, argv, wd, autoFork, forkChild) |
749 self.debugging = False |
786 self.debugging = False |
899 def __remoteWatchpoint(self, cond, set, temp=False): |
942 def __remoteWatchpoint(self, cond, set, temp=False): |
900 """ |
943 """ |
901 Private method to set or clear a watch expression. |
944 Private method to set or clear a watch expression. |
902 |
945 |
903 @param cond expression of the watch expression (string) |
946 @param cond expression of the watch expression (string) |
904 @param set flag indicating setting or resetting a watch expression (boolean) |
947 @param set flag indicating setting or resetting a watch expression |
|
948 (boolean) |
905 @param temp flag indicating a temporary watch expression (boolean) |
949 @param temp flag indicating a temporary watch expression (boolean) |
906 """ |
950 """ |
907 # cond is combination of cond and special (s. watch expression viewer) |
951 # cond is combination of cond and special (s. watch expression viewer) |
908 self.debuggerInterface.remoteWatchpoint(cond, set, temp) |
952 self.debuggerInterface.remoteWatchpoint(cond, set, temp) |
909 |
953 |
910 def __remoteWatchpointEnable(self, cond, enable): |
954 def __remoteWatchpointEnable(self, cond, enable): |
911 """ |
955 """ |
912 Private method to enable or disable a watch expression. |
956 Private method to enable or disable a watch expression. |
913 |
957 |
914 @param cond expression of the watch expression (string) |
958 @param cond expression of the watch expression (string) |
915 @param enable flag indicating enabling or disabling a watch expression (boolean) |
959 @param enable flag indicating enabling or disabling a watch expression |
|
960 (boolean) |
916 """ |
961 """ |
917 # cond is combination of cond and special (s. watch expression viewer) |
962 # cond is combination of cond and special (s. watch expression viewer) |
918 self.debuggerInterface.remoteWatchpointEnable(cond, enable) |
963 self.debuggerInterface.remoteWatchpointEnable(cond, enable) |
919 |
964 |
920 def __remoteWatchpointIgnore(self, cond, count): |
965 def __remoteWatchpointIgnore(self, cond, count): |
921 """ |
966 """ |
922 Private method to ignore a watch expression the next couple of occurrences. |
967 Private method to ignore a watch expression the next couple of |
|
968 occurrences. |
923 |
969 |
924 @param cond expression of the watch expression (string) |
970 @param cond expression of the watch expression (string) |
925 @param count number of occurrences to ignore (int) |
971 @param count number of occurrences to ignore (int) |
926 """ |
972 """ |
927 # cond is combination of cond and special (s. watch expression viewer) |
973 # cond is combination of cond and special (s. watch expression viewer) |
1023 |
1072 |
1024 @param text the text to be completed (string) |
1073 @param text the text to be completed (string) |
1025 """ |
1074 """ |
1026 self.debuggerInterface.remoteCompletion(text) |
1075 self.debuggerInterface.remoteCompletion(text) |
1027 |
1076 |
1028 def remoteUTPrepare(self, fn, tn, tfn, failed, cov, covname, coverase, clientType=""): |
1077 def remoteUTPrepare(self, fn, tn, tfn, failed, cov, covname, coverase, |
|
1078 clientType=""): |
1029 """ |
1079 """ |
1030 Public method to prepare a new unittest run. |
1080 Public method to prepare a new unittest run. |
1031 |
1081 |
1032 @param fn the filename to load (string) |
1082 @param fn the filename to load (string) |
1033 @param tn the testname to load (string) |
1083 @param tn the testname to load (string) |
1034 @param tfn the test function name to load tests from (string) |
1084 @param tfn the test function name to load tests from (string) |
1035 @param failed list of failed test, if only failed test should be run |
1085 @param failed list of failed test, if only failed test should be run |
1036 (list of strings) |
1086 (list of strings) |
1037 @param cov flag indicating collection of coverage data is requested (boolean) |
1087 @param cov flag indicating collection of coverage data is requested |
|
1088 (boolean) |
1038 @param covname filename to be used to assemble the coverage caches |
1089 @param covname filename to be used to assemble the coverage caches |
1039 filename (string) |
1090 filename (string) |
1040 @param coverase flag indicating erasure of coverage data is requested (boolean) |
1091 @param coverase flag indicating erasure of coverage data is requested |
|
1092 (boolean) |
1041 @keyparam clientType client type to be used (string) |
1093 @keyparam clientType client type to be used (string) |
1042 """ |
1094 """ |
1043 # Restart the client if there is already a program loaded. |
1095 # Restart the client if there is already a program loaded. |
1044 try: |
1096 try: |
1045 if clientType: |
1097 if clientType: |
1046 self.__setClientType(clientType) |
1098 self.__setClientType(clientType) |
1047 else: |
1099 else: |
1048 self.__setClientType(self.__clientAssociations[os.path.splitext(fn)[1]]) |
1100 self.__setClientType( |
|
1101 self.__clientAssociations[os.path.splitext(fn)[1]]) |
1049 except KeyError: |
1102 except KeyError: |
1050 self.__setClientType('Python3') # assume it is a Python3 file |
1103 self.__setClientType('Python3') # assume it is a Python3 file |
1051 self.startClient(False) |
1104 self.startClient(False) |
1052 |
1105 |
1053 self.debuggerInterface.remoteUTPrepare( |
1106 self.debuggerInterface.remoteUTPrepare( |
1134 |
1189 |
1135 @param more flag indicating that more user input is required |
1190 @param more flag indicating that more user input is required |
1136 """ |
1191 """ |
1137 self.clientStatement.emit(more) |
1192 self.clientStatement.emit(more) |
1138 |
1193 |
1139 def signalClientException(self, exceptionType, exceptionMessage, stackTrace): |
1194 def signalClientException(self, exceptionType, exceptionMessage, |
|
1195 stackTrace): |
1140 """ |
1196 """ |
1141 Public method to process the exception info from the client. |
1197 Public method to process the exception info from the client. |
1142 |
1198 |
1143 @param exceptionType type of exception raised (string) |
1199 @param exceptionType type of exception raised (string) |
1144 @param exceptionMessage message given by the exception (string) |
1200 @param exceptionMessage message given by the exception (string) |
1145 @param stackTrace list of stack entries with the exception position |
1201 @param stackTrace list of stack entries with the exception position |
1146 first. Each stack entry is a list giving the filename and the linenumber. |
1202 first. Each stack entry is a list giving the filename and the |
|
1203 linenumber. |
1147 """ |
1204 """ |
1148 if self.running: |
1205 if self.running: |
1149 self.clientException.emit(exceptionType, exceptionMessage, stackTrace) |
1206 self.clientException.emit(exceptionType, exceptionMessage, |
|
1207 stackTrace) |
1150 |
1208 |
1151 def signalClientSyntaxError(self, message, filename, lineNo, characterNo): |
1209 def signalClientSyntaxError(self, message, filename, lineNo, characterNo): |
1152 """ |
1210 """ |
1153 Public method to process the syntax error info from the client. |
1211 Public method to process the syntax error info from the client. |
1154 |
1212 |
1155 @param message message of the syntax error (string) |
1213 @param message message of the syntax error (string) |
1156 @param filename translated filename of the syntax error position (string) |
1214 @param filename translated filename of the syntax error position |
|
1215 (string) |
1157 @param lineNo line number of the syntax error position (integer) |
1216 @param lineNo line number of the syntax error position (integer) |
1158 @param characterNo character number of the syntax error position (integer) |
1217 @param characterNo character number of the syntax error position |
|
1218 (integer) |
1159 """ |
1219 """ |
1160 if self.running: |
1220 if self.running: |
1161 self.clientSyntaxError.emit(message, filename, lineNo, characterNo) |
1221 self.clientSyntaxError.emit(message, filename, lineNo, characterNo) |
1162 |
1222 |
1163 def signalClientExit(self, status): |
1223 def signalClientExit(self, status): |