private int LaunchProcessWithDebuggerAttached(string workingDirectory, string command, string param, bool printTestOutput, IDebuggedProcessLauncher handle) { _testEnvironment.LogInfo("Attaching debugger to " + command); if (printTestOutput) { _testEnvironment.DebugInfo( "Note that due to restrictions of the VS Unit Testing framework, the test executable's output can not be displayed in the test console when debugging tests!"); } int processId = handle.LaunchProcessWithDebuggerAttached(command, workingDirectory, param, _testEnvironment.Options.GetPathExtension(command)); Process process = Process.GetProcessById(processId); var waiter = new ProcessWaiter(process); waiter.WaitForExit(); process.Dispose(); return waiter.ProcessExitCode; }
private int LaunchProcessWithDebuggerAttached(string workingDirectory, IDictionary <string, string> envVars, string command, string param, bool printTestOutput, IDebuggedProcessLauncher handle) { _logger.LogInfo(String.Format(Resources.AttachDebuggerMessage, command)); if (printTestOutput) { _logger.DebugInfo(Resources.DebuggerAttachedOutputMessage); } _processId = handle.LaunchProcessWithDebuggerAttached(command, workingDirectory, envVars, param, _settings.GetPathExtension(command)); Process process = Process.GetProcessById(_processId.Value); var waiter = new ProcessWaiter(process); waiter.WaitForExit(); process.Dispose(); return(waiter.ProcessExitCode); }
private int LaunchProcessWithDebuggerAttached(string workingDirectory, string command, string param, bool printTestOutput, IDebuggedProcessLauncher handle) { _logger.LogInfo("Attaching debugger to " + command); if (printTestOutput) { _logger.DebugInfo( "Note that due to restrictions of the VS Unit Testing framework, the test executable's output can not be displayed in the test console when debugging tests!"); } int processId = handle.LaunchProcessWithDebuggerAttached(command, workingDirectory, param, _settings.GetPathExtension(command)); Process process = Process.GetProcessById(processId); var waiter = new ProcessWaiter(process); waiter.WaitForExit(); process.Dispose(); return(waiter.ProcessExitCode); }