예제 #1
0
        public static void CreateCttm(string emFilePath, string srcPath, string outputPath)
        {
            EmmaBinaryReader cebre = new EmmaBinaryReader(emFilePath);
            MetaDataDescriptor cedata = (MetaDataDescriptor)LoadEmmaFile(cebre);
            cebre.Close();
            Report.ReportDataModel current = new Report.ReportDataModel();
            Report.RootItem croot = current.CreateViewForDiff(cedata, srcPath);

            FileStream fs = new FileStream(outputPath, FileMode.OpenOrCreate);
            BinaryFormatter bf = new BinaryFormatter();
            bf.Serialize(fs, current);
            fs.Close();
            fs.Dispose();
        }
예제 #2
0
        private static ReportDataModel CreateModuleForCttr(string emFilePath, CttCaseCollection ecFilesPaths, string srcPath)
        {
            EmmaBinaryReader ebre = new EmmaBinaryReader(emFilePath);
            MetaDataDescriptor edata = (MetaDataDescriptor)LoadEmmaFile(ebre);
            ebre.Close();
            CaseCoverageDescriptor ccdata = new CaseCoverageDescriptor();

            foreach (CttCase cttCase in ecFilesPaths.CoverageFilePaths)
            {
                EmmaBinaryReader ebrc = new EmmaBinaryReader(cttCase.ResultPath);
                CoverageDataDescriptor cdata = (CoverageDataDescriptor)LoadEmmaFile(ebrc);
                ebrc.Close();

                ccdata.MergeCaseCoverageData(cdata, cttCase.CaseId);
            }

            ReportDataModel previous = new Report.ReportDataModel();
            RootItem root = previous.CreateViewForCaseCoverage(edata, ccdata, srcPath);
            return previous;
        }