コード例 #1
0
        public void InsertInstrumentationCode(string fileName)
        {
            var profile = LanguageSupports.GetCoverageModeByClassName("Java");

            CodeInsertTest.InsertInstrumentationCode(profile, fileName);

            var info = new CoverageInfo(
                Fixture.GetCoverageInputPath(), profile.Name, SharingMethod.SharedMemory);
            var inPath   = Path.Combine(Fixture.GetCoverageInputPath(), fileName);
            var codeFile = new FileInfo(inPath);

            var relativePath = ParaibaPath.GetRelativePath(codeFile.FullName, info.BasePath);
            var ast          = profile.CodeToXml.GenerateFromFile(codeFile.FullName);

            File.WriteAllText(Fixture.GetOutputPath(fileName) + ".xml", ast.ToString());

            // 測定用コードの埋め込み
            var path = relativePath;

            CodeTransformer.InstrumentStatementAndPredicate(info, ast, profile, path);

            File.WriteAllText(Fixture.GetOutputPath(fileName) + ".modified.xml", ast.ToString());
        }
コード例 #2
0
        public void InsertInstrumentationCode(string fileName)
        {
            var profile = LanguageSupports.GetCoverageModeByClassName("JavaScript");

            CodeInsertTest.InsertInstrumentationCode(profile, fileName);
        }
        public void VerifyInstrumentationCode(string fileName)
        {
            var profile = LanguageSupports.GetCoverageModeByClassName("CSharp");

            CodeInsertTest.VerifyCodeInsertion(profile, fileName);
        }