Keep stdout for test execution
Work around https://github.com/Microsoft/vstest/issues/1503 by using the MSBuild escape hatch variable MSBUILDENSURESTDOUTFORTASKPROCESSES and ensuring that tests don't run in a disconnected MSBuild process by passing /nr:false.
This commit is contained in:
parent
5e6765093a
commit
29ac66f7d2
1 changed files with 18 additions and 1 deletions
|
@ -32,6 +32,7 @@ namespace Microsoft.DotNet.Tools.Test
|
|||
{
|
||||
"/t:VSTest",
|
||||
"/v:quiet",
|
||||
"/nodereuse:false", // workaround for https://github.com/Microsoft/vstest/issues/1503
|
||||
"/nologo"
|
||||
};
|
||||
|
||||
|
@ -95,7 +96,23 @@ namespace Microsoft.DotNet.Tools.Test
|
|||
return e.ExitCode;
|
||||
}
|
||||
|
||||
return cmd.Execute();
|
||||
// Workaround for https://github.com/Microsoft/vstest/issues/1503
|
||||
const string NodeWindowEnvironmentName = "MSBUILDENSURESTDOUTFORTASKPROCESSES";
|
||||
string previousNodeWindowSetting = Environment.GetEnvironmentVariable(NodeWindowEnvironmentName);
|
||||
|
||||
int result = -1;
|
||||
|
||||
try
|
||||
{
|
||||
Environment.SetEnvironmentVariable(NodeWindowEnvironmentName, "1");
|
||||
result = cmd.Execute();
|
||||
}
|
||||
finally
|
||||
{
|
||||
Environment.SetEnvironmentVariable(NodeWindowEnvironmentName, previousNodeWindowSetting);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private static string GetSemiColonEscapedString(string arg)
|
||||
|
|
Loading…
Reference in a new issue