public ProcessOutput Execute(string commandName, string commandArgs) { ICommandLog commandLog = Log.BeginExecutingCommand(commandName, commandArgs); string commandArgumentsForLogging = commandLog.CommandArgumentsForLogging; var output = new CommandOutputReceiver(commandLog); Process p = CreateProcess(commandName, commandArgumentsForLogging, output); try { RunProcess(p); } catch (Win32Exception win32Ex) { if (win32Ex.NativeErrorCode == 2) { // executable file not found throw new ShellExecutableNotFoundException(commandName); } throw; } commandLog.CommandComplete(p.ExitCode); return(new ProcessOutput { ExitCode = p.ExitCode, Output = output.Output, Error = output.Error, ErrorAndOutput = output.ErrorAndOutput }); }
public void CommandComplete(int exitCode) { var resultsPath = Path.GetFullPath("TestResult.xml"); Output.WriteLine(TeamCityFormatter.FormatTeamCityMessageWithFields("importData", "type", "nunit", "path", resultsPath)); Log.CommandComplete(exitCode); }
public void CommandComplete(int exitCode) { Log.CommandComplete(exitCode); }