Skip to content
Browse files

Kill all ipy.exe processes after running tests.

  • Loading branch information...
1 parent af33202 commit 984851a7b4bbe609db30004572f3f7707c3ecc6e @jdhardy committed Jun 23, 2012
Showing with 21 additions and 1 deletion.
  1. +16 −0 Test/TestRunner/TestRunner/Program.cs
  2. +5 −1 Test/test-ipy-tc.cmd
View
16 Test/TestRunner/TestRunner/Program.cs
@@ -199,9 +199,25 @@ class Program {
Console.ForegroundColor = originalColor;
+ Cleanup(binPath);
+
return failures.Count;
}
+ private void Cleanup(string binPath) {
+ var ipy = Path.Combine(binPath, "ipy.exe");
+
+ var victims = Process.GetProcessesByName("ipy").Where(p => p.MainModule.FileName == ipy);
+ foreach (var victim in victims) {
+ try {
+ Console.WriteLine("ipy.exe ({0}) still running; killing...");
+ victim.Kill();
+ } catch (Exception e) {
+ Console.WriteLine(e.Message);
+ }
+ }
+ }
+
private void RunTestForConsole(Test test) {
lock (this) {
if (!_quiet && _verbose) {
View
6 Test/test-ipy-tc.cmd
@@ -2,12 +2,16 @@
setlocal
+if "%DLR_ROOT%" == "" set DLR_ROOT=%~dp0..
+if "%DLR_BIN%" == "" set DLR_BIN=%DLR_ROOT%\bin\Debug
+
set _test_root=%DLR_ROOT%\Test
set _runner=%_test_root%\TestRunner\TestRunner\bin\Debug\TestRunner.exe
+set _binpath=%DLR_BIN%
call :build_runner
-"%_runner%" "%_test_root%\IronPython.tests" /verbose /threads:2 /binpath:"%DLR_BIN%" %*
+"%_runner%" "%_test_root%\IronPython.tests" /verbose /threads:2 /binpath:"%_binpath%" %*
endlocal
goto:eof

0 comments on commit 984851a

Please sign in to comment.
Something went wrong with that request. Please try again.