in GoogleTestAdapter/Core/Runners/SequentialTestRunner.cs [206:252]
private List<string> RunTestExecutableWithNewFramework(string executable, string workingDir, IDictionary<string, string> envVars,
CommandLineGenerator.Args arguments, IProcessExecutor executor,
StreamingStandardOutputTestResultParser streamingParser)
{
string pathExtension = _settings.GetPathExtension(executable);
bool printTestOutput = _settings.PrintTestOutput &&
!_settings.ParallelTestExecution;
if (printTestOutput)
_logger.LogInfo(String.Format(Resources.OutputOfCommandMessage, _threadName, executable, arguments.CommandLine));
Action<string> reportOutputAction = line =>
{
try
{
if (!_canceled)
streamingParser.ReportLine(line);
if (printTestOutput)
_logger.LogInfo(line);
}
catch (TestRunCanceledException e)
{
_logger.DebugInfo(String.Format(Resources.ExecutionCancelled, _threadName, e.InnerException?.Message ?? e.Message));
Cancel();
}
};
_processExecutor = executor;
_processExecutor.ExecuteCommandBlocking(
executable, arguments.CommandLine, workingDir, envVars, pathExtension,
reportOutputAction);
streamingParser.Flush();
if (printTestOutput)
_logger.LogInfo(String.Format(Resources.EndOfOutputMessage, _threadName));
var consoleOutput = new List<string>();
new TestDurationSerializer().UpdateTestDurations(streamingParser.TestResults);
_logger.DebugInfo(String.Format(Resources.ReportedResultsToVS, _threadName, streamingParser.TestResults.Count, executable));
foreach (TestResult result in streamingParser.TestResults)
{
if (!_schedulingAnalyzer.AddActualDuration(result.TestCase, (int) result.Duration.TotalMilliseconds))
_logger.LogWarning(String.Format(Resources.AlreadyInAnalyzer, _threadName, result.TestCase.FullyQualifiedName));
}
return consoleOutput;
}