Stream Forwarding changes to not wait on buffer full before writing. Instead input streams will be read character by character as they Console.Write or Console.WriteLine. Upon finding a newline character, the line will be printed to the parent process's console.

This commit is contained in:
Bryan Thornbury 2016-02-04 18:18:08 -08:00
parent 129bd03098
commit ccaaebf6e5
9 changed files with 256 additions and 153 deletions

View file

@ -32,8 +32,8 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
var stdOut = new StreamForwarder();
var stdErr = new StreamForwarder();
stdOut.ForwardTo(write: Reporter.Output.Write, writeLine: Reporter.Output.WriteLine);
stdErr.ForwardTo(write: Reporter.Error.Write, writeLine: Reporter.Output.WriteLine);
stdOut.ForwardTo(writeLine: Reporter.Output.WriteLine);
stdErr.ForwardTo(writeLine: Reporter.Output.WriteLine);
return RunProcess(commandPath, args, stdOut, stdErr);
}
@ -82,8 +82,8 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
var result = new CommandResult(
process.StartInfo,
process.ExitCode,
stdOut.GetCapturedOutput(),
stdErr.GetCapturedOutput());
stdOut.CapturedOutput,
stdErr.CapturedOutput);
return result;
}