예제 #1
0
        private static void WriteProductionCodeFiles(
            DirectoryInfo rootDir, IEnumerable <FileInfo> fileInfos, LanguageSupport mode,
            CoverageInfo info)
        {
            foreach (var path in fileInfos)
            {
                // 対象ファイルに対してKlee_backやLine_backがあるときは作成しない
                // Avoid ge
                if (!(File.Exists(path.FullName + OccfNames.LineBackUpSuffix)) &&
                    !(File.Exists(path.FullName + OccfNames.KleeBackUpSuffix)))
                {
                    var backPath = Path.Combine(rootDir.FullName,
                                                path.FullName + OccfNames.BackupSuffix);
                    path.CopyTo(backPath, true);
                }

                var outPath = OccfCodeGenerator.WriteCoveragedCode(mode, info, path, rootDir);
                Console.WriteLine("wrote:" + outPath);
            }
        }
예제 #2
0
        private void BtnStartClick(object sender, EventArgs e)
        {
            var files      = clbFiles.CheckedItems.Cast <string>();
            var basePath   = txtBase.Text.AddIfNotEndsWith('\\');
            var outDirPath = txtOutput.Text.AddIfNotEndsWith('\\');

            var filePathList = files.ToList();
            var langName     = cmbLanguage.Text;

            Action action = () => {
                var profile = LanguageSupports.GetCoverageModeByClassName(langName);
                var info    = new CoverageInfo(basePath, profile.Name, SharingMethod.File);
                var outDir  = new DirectoryInfo(outDirPath);
                foreach (var filePath in filePathList)
                {
                    OccfCodeGenerator.WriteCoveragedCode(
                        profile, info, new FileInfo(filePath), outDir);
                }
                info.Write(new DirectoryInfo(outDirPath));
            };

            ProgressForm.Start(this, filePathList.Count, action);
        }