Debugger/DebugServer.py

changeset 6904
3f35037a08d4
parent 6901
f2c774c8db7e
child 6923
d062df8f1d9f
--- a/Debugger/DebugServer.py	Tue Mar 26 19:39:42 2019 +0100
+++ b/Debugger/DebugServer.py	Wed Mar 27 20:09:37 2019 +0100
@@ -69,8 +69,8 @@
         detected on the client side
     @signal clientSignal(signal) emitted after a signal has been generated on
         the client side
-    @signal clientExit(int) emitted with the exit status after the client has
-        exited
+    @signal clientExit(int, str, bool) emitted after the client has exited
+        giving the exit status, an exit message and an indication to be quiet
     @signal clientClearBreak(filename, lineno) emitted after the debug client
         has decided to clear a temporary breakpoint
     @signal clientBreakConditionError(fn, lineno) emitted after the client has
@@ -136,7 +136,7 @@
     clientException = pyqtSignal(str, str, list)
     clientSyntaxError = pyqtSignal(str, str, int, int)
     clientSignal = pyqtSignal(str, str, int, str, str)
-    clientExit = pyqtSignal(int, str)
+    clientExit = pyqtSignal(int, str, bool)
     clientBreakConditionError = pyqtSignal(str, int)
     clientWatchConditionError = pyqtSignal(str)
     clientRawInput = pyqtSignal(str, bool)
@@ -1359,7 +1359,7 @@
     def remoteUTPrepare(self, fn, tn, tfn, failed, cov, covname, coverase,
                         clientType="", forProject=False, venvName="",
                         syspath=None, workdir="", discover=False,
-                        discoveryStart="", testCases=None):
+                        discoveryStart="", testCases=None, debug=False):
         """
         Public method to prepare a new unittest run.
         
@@ -1395,6 +1395,8 @@
         @type str
         @param testCases list of test cases to be loaded
         @type list of str
+        @param debug flag indicating to run unittest with debugging
+        @type bool
         """
         if clientType and clientType not in self.getSupportedLanguages():
             # a not supported client language was requested
@@ -1420,15 +1422,23 @@
         
         self.debuggerInterface.remoteUTPrepare(
             fn, tn, tfn, failed, cov, covname, coverase, syspath, workdir,
-            discover, discoveryStart, testCases)
-        self.debugging = False
+            discover, discoveryStart, testCases, debug)
         self.running = True
+        self.debugging = debug
+        if debug:
+            self.__restoreBreakpoints()
+            self.__restoreWatchpoints()
         
-    def remoteUTRun(self):
+    def remoteUTRun(self, debug=False, failfast=False):
         """
         Public method to start a unittest run.
+        
+        @param debug flag indicating to run unittest with debugging
+        @type bool
+        @param failfast flag indicating to stop at the first error
+        @type bool
         """
-        self.debuggerInterface.remoteUTRun()
+        self.debuggerInterface.remoteUTRun(debug, failfast)
         
     def remoteUTStop(self):
         """
@@ -1567,7 +1577,7 @@
         """
         if self.passive:
             self.__passiveShutDown()
-        self.clientExit.emit(int(status), message)
+        self.clientExit.emit(int(status), message, False)
         if Preferences.getDebugger("AutomaticReset") or (self.running and
                                                          not self.debugging):
             self.debugging = False
@@ -1767,12 +1777,19 @@
         """
         self.utTestSucceededUnexpected.emit(testname, testId)
         
-    def clientUtFinished(self):
+    def clientUtFinished(self, status):
         """
         Public method to process the client unit test finished info.
+        
+        @param status exit status of the unit test
+        @type int
         """
         self.utFinished.emit()
         
+        self.clientExit.emit(int(status), "", True)
+        self.debugging = False
+        self.running = False
+        
     def passiveStartUp(self, fn, exc):
         """
         Public method to handle a passive debug connection.

eric ide

mercurial