Browse Source
Added tests for process termination. Tracking of COM objects is no longer outputted to the console. git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@3132 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61shortcuts
12 changed files with 139 additions and 15 deletions
@ -0,0 +1,57 @@ |
|||||||
|
// <file>
|
||||||
|
// <copyright see="prj:///doc/copyright.txt"/>
|
||||||
|
// <license see="prj:///doc/license.txt"/>
|
||||||
|
// <owner name="David Srbecký" email="dsrbecky@gmail.com"/>
|
||||||
|
// <version>$Revision$</version>
|
||||||
|
// </file>
|
||||||
|
|
||||||
|
using System; |
||||||
|
|
||||||
|
namespace Debugger.Tests.TestPrograms |
||||||
|
{ |
||||||
|
public class TerminatePausedProcess |
||||||
|
{ |
||||||
|
public static void Main() |
||||||
|
{ |
||||||
|
System.Diagnostics.Debugger.Break(); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
#if TEST_CODE
|
||||||
|
namespace Debugger.Tests { |
||||||
|
public partial class DebuggerTests |
||||||
|
{ |
||||||
|
[NUnit.Framework.Test] |
||||||
|
public void TerminatePausedProcess() |
||||||
|
{ |
||||||
|
StartTest("TerminatePausedProcess.cs"); |
||||||
|
process.Terminate(); |
||||||
|
process.WaitForExit(); |
||||||
|
|
||||||
|
StartTest("TerminatePausedProcess.cs"); |
||||||
|
process.Terminate(); |
||||||
|
process.WaitForExit(); |
||||||
|
CheckXmlOutput(); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
#endif
|
||||||
|
|
||||||
|
#if EXPECTED_OUTPUT
|
||||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||||
|
<DebuggerTests> |
||||||
|
<Test name="TerminatePausedProcess.cs"> |
||||||
|
<ProcessStarted /> |
||||||
|
<ModuleLoaded symbols="False">mscorlib.dll</ModuleLoaded> |
||||||
|
<ModuleLoaded symbols="True">TerminatePausedProcess.exe</ModuleLoaded> |
||||||
|
<DebuggingPaused>Break</DebuggingPaused> |
||||||
|
<ProcessExited /> |
||||||
|
<ProcessStarted /> |
||||||
|
<ModuleLoaded symbols="False">mscorlib.dll</ModuleLoaded> |
||||||
|
<ModuleLoaded symbols="True">TerminatePausedProcess.exe</ModuleLoaded> |
||||||
|
<DebuggingPaused>Break</DebuggingPaused> |
||||||
|
<ProcessExited /> |
||||||
|
</Test> |
||||||
|
</DebuggerTests> |
||||||
|
#endif // EXPECTED_OUTPUT
|
@ -0,0 +1,54 @@ |
|||||||
|
// <file>
|
||||||
|
// <copyright see="prj:///doc/copyright.txt"/>
|
||||||
|
// <license see="prj:///doc/license.txt"/>
|
||||||
|
// <owner name="David Srbecký" email="dsrbecky@gmail.com"/>
|
||||||
|
// <version>$Revision$</version>
|
||||||
|
// </file>
|
||||||
|
|
||||||
|
using System; |
||||||
|
using System.Threading; |
||||||
|
|
||||||
|
namespace Debugger.Tests.TestPrograms |
||||||
|
{ |
||||||
|
public class TerminateRunningProcess |
||||||
|
{ |
||||||
|
static ManualResetEvent doSomething = new ManualResetEvent(false); |
||||||
|
|
||||||
|
public static void Main() |
||||||
|
{ |
||||||
|
doSomething.WaitOne(); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
#if TEST_CODE
|
||||||
|
namespace Debugger.Tests { |
||||||
|
public partial class DebuggerTests |
||||||
|
{ |
||||||
|
[NUnit.Framework.Test] |
||||||
|
public void TerminateRunningProcess() |
||||||
|
{ |
||||||
|
StartTest("TerminateRunningProcess.cs", false); |
||||||
|
process.Terminate(); |
||||||
|
process.WaitForExit(); |
||||||
|
|
||||||
|
StartTest("TerminateRunningProcess.cs", false); |
||||||
|
process.Terminate(); |
||||||
|
process.WaitForExit(); |
||||||
|
CheckXmlOutput(); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
#endif
|
||||||
|
|
||||||
|
#if EXPECTED_OUTPUT
|
||||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||||
|
<DebuggerTests> |
||||||
|
<Test name="TerminateRunningProcess.cs"> |
||||||
|
<ProcessStarted /> |
||||||
|
<ProcessExited /> |
||||||
|
<ProcessStarted /> |
||||||
|
<ProcessExited /> |
||||||
|
</Test> |
||||||
|
</DebuggerTests> |
||||||
|
#endif // EXPECTED_OUTPUT
|
Loading…
Reference in new issue