protected override void Initialize() { base.Initialize(); var componentModel = (IComponentModel)GetGlobalService(typeof(SComponentModel)); _globalRunSettings = componentModel.GetService <IGlobalRunSettingsInternal>(); _generalOptions = (GeneralOptionsDialogPage)GetDialogPage(typeof(GeneralOptionsDialogPage)); _parallelizationOptions = (ParallelizationOptionsDialogPage)GetDialogPage(typeof(ParallelizationOptionsDialogPage)); _googleTestOptions = (GoogleTestOptionsDialogPage)GetDialogPage(typeof(GoogleTestOptionsDialogPage)); _globalRunSettings.RunSettings = GetRunSettingsFromOptionPages(); _generalOptions.PropertyChanged += OptionsChanged; _parallelizationOptions.PropertyChanged += OptionsChanged; _googleTestOptions.PropertyChanged += OptionsChanged; SwitchCatchExceptionsOptionCommand.Initialize(this); SwitchBreakOnFailureOptionCommand.Initialize(this); SwitchParallelExecutionOptionCommand.Initialize(this); SwitchPrintTestOutputOptionCommand.Initialize(this); var thread = new Thread(DisplayReleaseNotesIfNecessary); thread.SetApartmentState(ApartmentState.STA); thread.Start(); var logger = new ActivityLogLogger(this, () => _generalOptions.DebugMode); var debuggerAttacher = new VsDebuggerAttacher(this); _debuggerAttacherService = new DebuggerAttacherService(_debuggingNamedPipeId, debuggerAttacher, logger); }
private void InitializeDebuggerAttacherService() { var logger = new ActivityLogLogger(this, () => _generalOptions.DebugMode); var debuggerAttacher = new VsDebuggerAttacher(this); _debuggerAttacherServiceHost = new DebuggerAttacherServiceHost(_debuggingNamedPipeId, debuggerAttacher, logger); try { _debuggerAttacherServiceHost.Open(); } catch (CommunicationException) { _debuggerAttacherServiceHost.Abort(); _debuggerAttacherServiceHost = null; } }
protected override async Task InitializeAsync(CancellationToken cancellationToken, IProgress <ServiceProgressData> progress) { await base.InitializeAsync(cancellationToken, progress); var componentModel = await GetServiceAsync(typeof(SComponentModel)) as IComponentModel; _globalRunSettings = componentModel.GetService <IGlobalRunSettingsInternal>(); await this.JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken); _generalOptions = (GeneralOptionsDialogPage)GetDialogPage(typeof(GeneralOptionsDialogPage)); _parallelizationOptions = (ParallelizationOptionsDialogPage)GetDialogPage(typeof(ParallelizationOptionsDialogPage)); _googleTestOptions = (GoogleTestOptionsDialogPage)GetDialogPage(typeof(GoogleTestOptionsDialogPage)); _globalRunSettings.RunSettings = GetRunSettingsFromOptionPages(); _generalOptions.PropertyChanged += OptionsChanged; _parallelizationOptions.PropertyChanged += OptionsChanged; _googleTestOptions.PropertyChanged += OptionsChanged; SwitchCatchExceptionsOptionCommand.Initialize(this); SwitchBreakOnFailureOptionCommand.Initialize(this); SwitchParallelExecutionOptionCommand.Initialize(this); SwitchPrintTestOutputOptionCommand.Initialize(this); DisplayReleaseNotesIfNecessary(); var logger = new ActivityLogLogger(this, () => _generalOptions.DebugMode); var debuggerAttacher = new VsDebuggerAttacher(this); _debuggerAttacherServiceHost = new DebuggerAttacherServiceHost(_debuggingNamedPipeId, debuggerAttacher, logger); try { _debuggerAttacherServiceHost.Open(); } catch (CommunicationException) { _debuggerAttacherServiceHost.Abort(); _debuggerAttacherServiceHost = null; } }
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(); }