コード例 #1
0
        private async Task TestExecutionStartingAsync(IOperation operation)
        {
            cancelling        = false;
            runningInParallel = false;
            StopCoverage();

            var settings = appOptionsProvider.Get();

            if (!settings.Enabled)
            {
                CombinedLog("Coverage not collected as FCC disabled.");
                reportGeneratorUtil.EndOfCoverageRun();
                return;
            }

            msCodeCoverageCollectionStatus = await msCodeCoverageRunSettingsService.IsCollectingAsync(testOperationFactory.Create(operation));

            if (msCodeCoverageCollectionStatus == MsCodeCoverageCollectionStatus.NotCollecting)
            {
                if (settings.RunInParallel)
                {
                    runningInParallel = true;
                    fccEngine.ReloadCoverage(() =>
                    {
                        return(testOperationFactory.Create(operation).GetCoverageProjectsAsync());
                    });
                }
                else
                {
                    CombinedLog("Coverage collected when tests finish. RunInParallel option true for immediate");
                }
            }
        }
コード例 #2
0
 private Task InitializeIsCollectingAsync(ITestOperation testOperation)
 {
     collectionStatus  = MsCodeCoverageCollectionStatus.NotCollecting;
     runMsCodeCoverage = appOptionsProvider.Get().RunMsCodeCoverage;
     useMsCodeCoverage = runMsCodeCoverage == RunMsCodeCoverage.Yes;
     userRunSettingsProjectDetailsLookup = null;
     return(CleanUpAsync(testOperation));
 }
コード例 #3
0
        public async Task <IAppOptions> GetSettingsAsync(ICoverageProject coverageProject)
        {
            var projectDirectory       = Path.GetDirectoryName(coverageProject.ProjectFile);
            var settingsFilesElements  = fccSettingsFilesProvider.Provide(projectDirectory);
            var projectSettingsElement = await coverageProjectSettingsProvider.ProvideAsync(coverageProject);

            return(settingsMerger.Merge(appOptionsProvider.Get(), settingsFilesElements, projectSettingsElement));
        }
コード例 #4
0
        public CoverageLineMarkTaggerProvider(
            IEventAggregator eventAggregator,
            IAppOptionsProvider appOptionsProvider
            ) : base(eventAggregator)
        {
            var appOptions = appOptionsProvider.Get();

            coverageMarginOptions              = CoverageMarginOptions.Create(appOptions);
            appOptionsProvider.OptionsChanged += AppOptionsProvider_OptionsChanged;
        }
コード例 #5
0
        private void TestExecutionStarting(IOperation operation)
        {
            fccEngine.StopCoverage();

            var settings = appOptionsProvider.Get();

            if (!settings.Enabled)
            {
                return;
            }
            if (settings.RunInParallel)
            {
                fccEngine.ReloadCoverage(() =>
                {
                    var testOperation = testOperationFactory.Create(operation);
                    return(testOperation.GetCoverageProjectsAsync());
                });
            }
        }
        public string Provide(Func <string> solutionFolderProvider)
        {
            var appOptions = appOptionsProvider.Get();

            if (!String.IsNullOrEmpty(appOptions.FCCSolutionOutputDirectoryName))
            {
                var solutionFolder = solutionFolderProvider();
                if (solutionFolder != null)
                {
                    return(Path.Combine(solutionFolder, appOptions.FCCSolutionOutputDirectoryName));
                }
            }
            return(null);
        }
コード例 #7
0
        public CoverageColorProvider(
            [Import(typeof(SVsServiceProvider))] IServiceProvider serviceProvider,
            IAppOptionsProvider appOptionsProvider,
            ILogger logger
            )
        {
            lazyIVsFontAndColorStorage = new AsyncLazy <IVsFontAndColorStorage>(async() =>
            {
                await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();
                return((IVsFontAndColorStorage)serviceProvider.GetService(typeof(IVsFontAndColorStorage)));
            }, ThreadHelper.JoinableTaskFactory);

            coverageColoursFromFontsAndColours = appOptionsProvider.Get().CoverageColoursFromFontsAndColours;
            appOptionsProvider.OptionsChanged += AppOptionsProvider_OptionsChanged;
            this.logger = logger;
            DetermineColors();
        }
コード例 #8
0
        private string GetAppDataFolder()
        {
            var dir = appOptionsProvider.Get().ToolsDirectory;

            return(Directory.Exists(dir) ? dir : Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData));
        }