private void DoRunTests(ICollection <TestCase> testCasesToRun, IRunContext runContext, IFrameworkHandle frameworkHandle) { if (testCasesToRun.Count == 0) { return; } bool isRunningInsideVisualStudio = !string.IsNullOrEmpty(runContext.SolutionDirectory); var reporter = new VsTestFrameworkReporter(frameworkHandle, isRunningInsideVisualStudio, _logger); var debuggerAttacher = _debuggerAttacher ?? new MessageBasedDebuggerAttacher(_settings.DebuggingNamedPipeId, _logger); var processExecutorFactory = new DebuggedProcessExecutorFactory(frameworkHandle, debuggerAttacher); var exitCodeTestsAggregator = new ExitCodeTestsAggregator(); var exitCodeTestsReporter = new ExitCodeTestsReporter(reporter, exitCodeTestsAggregator, _settings, _logger); lock (_lock) { if (_canceled) { return; } _executor = new GoogleTestExecutor(_logger, _settings, processExecutorFactory, exitCodeTestsReporter); } _executor.RunTests(testCasesToRun, reporter, runContext.IsBeingDebugged); reporter.AllTestsFinished(); }
private void DoRunTests(ICollection <TestCase> testCasesToRun, IRunContext runContext, IFrameworkHandle frameworkHandle) { if (testCasesToRun.Count == 0) { return; } bool isRunningInsideVisualStudio = !string.IsNullOrEmpty(runContext.SolutionDirectory); var reporter = new VsTestFrameworkReporter(frameworkHandle, isRunningInsideVisualStudio, _logger); var launcher = new DebuggedProcessLauncher(frameworkHandle); ProcessExecutor processExecutor = null; if (_settings.UseNewTestExecutionFramework) { IDebuggerAttacher debuggerAttacher = null; if (runContext.IsBeingDebugged) { debuggerAttacher = new MessageBasedDebuggerAttacher(_settings.DebuggingNamedPipeId, _logger); } processExecutor = new ProcessExecutor(debuggerAttacher, _logger); } lock (_lock) { if (_canceled) { return; } _executor = new GoogleTestExecutor(_logger, _settings); } _executor.RunTests(testCasesToRun, reporter, launcher, runContext.IsBeingDebugged, runContext.SolutionDirectory, processExecutor); reporter.AllTestsFinished(); }
private void DoRunTests( IEnumerable <TestCase> allTestCasesInExecutables, IEnumerable <TestCase> testCasesToRun, IRunContext runContext, IFrameworkHandle frameworkHandle) { bool isRunningInsideVisualStudio = !string.IsNullOrEmpty(runContext.SolutionDirectory); var reporter = new VsTestFrameworkReporter(frameworkHandle, isRunningInsideVisualStudio); var launcher = new DebuggedProcessLauncher(frameworkHandle); _executor = new GoogleTestExecutor(_testEnvironment); _executor.RunTests(allTestCasesInExecutables, testCasesToRun, reporter, launcher, runContext.IsBeingDebugged, runContext.SolutionDirectory); reporter.AllTestsFinished(); }
private void DoRunTests( IEnumerable <TestCase> allTestCasesInExecutables, ICollection <TestCase> testCasesToRun, IRunContext runContext, IFrameworkHandle frameworkHandle, Stopwatch stopwatch) { bool isRunningInsideVisualStudio = !string.IsNullOrEmpty(runContext.SolutionDirectory); var reporter = new VsTestFrameworkReporter(frameworkHandle, isRunningInsideVisualStudio); var launcher = new DebuggedProcessLauncher(frameworkHandle); _executor = new GoogleTestExecutor(_testEnvironment); _executor.RunTests(allTestCasesInExecutables, testCasesToRun, reporter, launcher, runContext.IsBeingDebugged, runContext.SolutionDirectory); reporter.AllTestsFinished(); stopwatch.Stop(); _testEnvironment.LogInfo($"Google Test execution completed, overall duration: {stopwatch.Elapsed}."); }
private void DoRunTests( IEnumerable <TestCase> allTestCasesInExecutables, ICollection <TestCase> testCasesToRun, IRunContext runContext, IFrameworkHandle frameworkHandle) { bool isRunningInsideVisualStudio = !string.IsNullOrEmpty(runContext.SolutionDirectory); var reporter = new VsTestFrameworkReporter(frameworkHandle, isRunningInsideVisualStudio); var launcher = new DebuggedProcessLauncher(frameworkHandle); ProcessExecutor processExecutor = null; if (_settings.UseNewTestExecutionFramework) { IDebuggerAttacher debuggerAttacher = null; if (runContext.IsBeingDebugged) { debuggerAttacher = new VsDebuggerAttacher(_logger, _settings.VisualStudioProcessId); } processExecutor = new ProcessExecutor(debuggerAttacher, _logger); } _executor = new GoogleTestExecutor(_logger, _settings); _executor.RunTests(allTestCasesInExecutables, testCasesToRun, reporter, launcher, runContext.IsBeingDebugged, runContext.SolutionDirectory, processExecutor); reporter.AllTestsFinished(); }
private void DoRunTests( IEnumerable<TestCase> allTestCasesInExecutables, ICollection<TestCase> testCasesToRun, IRunContext runContext, IFrameworkHandle frameworkHandle, Stopwatch stopwatch) { bool isRunningInsideVisualStudio = !string.IsNullOrEmpty(runContext.SolutionDirectory); var reporter = new VsTestFrameworkReporter(frameworkHandle, isRunningInsideVisualStudio); var launcher = new DebuggedProcessLauncher(frameworkHandle); _executor = new GoogleTestExecutor(_testEnvironment); _executor.RunTests(allTestCasesInExecutables, testCasesToRun, reporter, launcher, runContext.IsBeingDebugged, runContext.SolutionDirectory); reporter.AllTestsFinished(); stopwatch.Stop(); _testEnvironment.LogInfo($"Google Test execution completed, overall duration: {stopwatch.Elapsed}."); }