private IEnumerable <TestResult> TryRunTests(string executable, string workingDir, bool isBeingDebugged,
                                                     IDebuggedProcessLauncher debuggedLauncher, CommandLineGenerator.Args arguments, string resultXmlFile, IProcessExecutor executor,
                                                     StreamingStandardOutputTestResultParser streamingParser)
        {
            List <string> consoleOutput;

            if (_settings.UseNewTestExecutionFramework)
            {
                DebugUtils.AssertIsNotNull(executor, nameof(executor));
                consoleOutput = RunTestExecutableWithNewFramework(executable, workingDir, arguments, executor, streamingParser);
            }
            else
            {
                _processLauncher = new TestProcessLauncher(_logger, _settings, isBeingDebugged);
                consoleOutput    =
                    _processLauncher.GetOutputOfCommand(workingDir, executable, arguments.CommandLine,
                                                        _settings.PrintTestOutput && !_settings.ParallelTestExecution, false,
                                                        debuggedLauncher);
            }

            var remainingTestCases =
                arguments.TestCases.Except(streamingParser.TestResults.Select(tr => tr.TestCase));
            var testResults = new TestResultCollector(_logger, _threadName)
                              .CollectTestResults(remainingTestCases, resultXmlFile, consoleOutput, streamingParser.CrashedTestCase);

            testResults = testResults.OrderBy(tr => tr.TestCase.FullyQualifiedName).ToList();

            return(testResults);
        }
예제 #2
0
        private IEnumerable <TestResult> TryRunTests(string executable, string workingDir, bool isBeingDebugged,
                                                     IDebuggedProcessExecutorFactory processExecutorFactory, CommandLineGenerator.Args arguments, string resultXmlFile,
                                                     StreamingStandardOutputTestResultParser streamingParser)
        {
            var consoleOutput =
                RunTestExecutable(executable, workingDir, arguments, isBeingDebugged, processExecutorFactory, streamingParser);

            var remainingTestCases =
                arguments.TestCases.Except(streamingParser.TestResults.Select(tr => tr.TestCase));
            var testResults = new TestResultCollector(_logger, _threadName)
                              .CollectTestResults(remainingTestCases, executable, resultXmlFile, consoleOutput, streamingParser.CrashedTestCase);

            testResults = testResults.OrderBy(tr => tr.TestCase.FullyQualifiedName).ToList();

            return(testResults);
        }