コード例 #1
0
        //---------------------------------------------------------------------
        void RunCoverage(MainSettings settings)
        {
            outputWindowWriter.ActivatePane();
            outputWindowWriter.WriteLine("Start computing code coverage...");

            if (!File.Exists(settings.BasicSettings.ProgramToRun))
            {
                throw new VSPackageException(
                          string.Format(InvalidProgramToRunMsg, settings.BasicSettings.ProgramToRun));
            }

            System.Threading.Tasks.Task onCoverageFinished;
            var coveragePath = new TemporaryFile();

            try
            {
                AddBinaryOutput(settings.ImportExportSettings, coveragePath);
                onCoverageFinished = openCppCoverageRunner.RunCodeCoverageAsync(settings);
            }
            catch (Exception)
            {
                coveragePath.Dispose();
                throw;
            }

            onCoverageFinished.ContinueWith(task =>
                                            OnCoverageFinishedAsync(task, coveragePath, onCoverageFinished).Wait());
        }
コード例 #2
0
        //---------------------------------------------------------------------
        void RunCoverage(MainSettings settings)
        {
            outputWindowWriter.ActivatePane();
            outputWindowWriter.WriteLine("Start computing code coverage...");

            if (!File.Exists(settings.BasicSettings.ProgramToRun))
            {
                throw new VSPackageException(
                          string.Format(InvalidProgramToRunMsg, settings.BasicSettings.ProgramToRun));
            }

            var coveragePath       = AddBinaryOutput(settings.ImportExportSettings);
            var openCppCoverage    = new OpenCppCoverage(outputWindowWriter);
            var onCoverageFinished = openCppCoverage.RunCodeCoverageAsync(settings);

            onCoverageFinished.ContinueWith(task =>
                                            OnCoverageFinishedAsync(task, coveragePath, onCoverageFinished).Wait());
        }