diff options
author | Lluis Sanchez Gual <lluis@novell.com> | 2011-03-07 21:34:27 +0300 |
---|---|---|
committer | Lluis Sanchez Gual <lluis@novell.com> | 2011-03-07 21:35:39 +0300 |
commit | f3bb1fa445cb6f308a5162df20bbce269e1ce8b2 (patch) | |
tree | 944bb57003f81d17b054d8217f637ca78a117d6f /main/src/addins/NUnit | |
parent | 88e1bdce0b70db51665f3dbe0eca9ee70c61d6ed (diff) |
Fix bug 669140 - Allow the soft debugger to stop debugging or to 'detach'
Use Shutdown instead of Dispose to stop the execution of tests.
Dispose doesn't work if the test process is not responding (for
example, if it is stopped in a breakpoint). Shutdown just kills the
process.
Diffstat (limited to 'main/src/addins/NUnit')
-rw-r--r-- | main/src/addins/NUnit/Services/NUnitAssemblyTestSuite.cs | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/main/src/addins/NUnit/Services/NUnitAssemblyTestSuite.cs b/main/src/addins/NUnit/Services/NUnitAssemblyTestSuite.cs index faf278ac40..0c8bf331f7 100644 --- a/main/src/addins/NUnit/Services/NUnitAssemblyTestSuite.cs +++ b/main/src/addins/NUnit/Services/NUnitAssemblyTestSuite.cs @@ -369,14 +369,18 @@ namespace MonoDevelop.NUnit if (testName != null) result = localMonitor.SingleTestResult; } catch (Exception ex) { - LoggingService.LogError (ex.ToString ()); - if (localMonitor.RunningTest != null) { - RuntimeErrorCleanup (testContext, localMonitor.RunningTest, ex); + if (!localMonitor.Canceled) { + LoggingService.LogError (ex.ToString ()); + if (localMonitor.RunningTest != null) { + RuntimeErrorCleanup (testContext, localMonitor.RunningTest, ex); + } else { + testContext.Monitor.ReportRuntimeError (null, ex); + throw ex; + } + result = UnitTestResult.CreateFailure (ex); } else { - testContext.Monitor.ReportRuntimeError (null, ex); - throw ex; + result = UnitTestResult.CreateFailure (GettextCatalog.GetString ("Canceled"), null); } - result = UnitTestResult.CreateFailure (ex); } finally { testContext.Monitor.CancelRequested -= new TestHandler (rd.Cancel); runner.Dispose (); @@ -431,7 +435,7 @@ namespace MonoDevelop.NUnit public void Cancel () { LocalMonitor.Canceled = true; - Runner.Dispose (); + Runner.Shutdown (); ClearRunningStatus (Test); } |