Search in sources :

Example 16 with CoverageBuilder

use of org.jacoco.core.analysis.CoverageBuilder in project dspot by STAMP-project.

the class JacocoExecutor method coverageResults.

private CoverageResults coverageResults(ExecutionDataStore executionData) {
    final String classesDirectory = this.program.getProgramDir() + "/" + this.program.getClassesDir();
    final CoverageBuilder coverageBuilder = new CoverageBuilder();
    final Analyzer analyzer = new Analyzer(executionData, coverageBuilder);
    try {
        analyzer.analyzeAll(new File(classesDirectory));
    } catch (IOException e) {
        throw new RuntimeException(e);
    }
    return new CoverageResults(coverageBuilder);
}
Also used : CoverageBuilder(org.jacoco.core.analysis.CoverageBuilder) IOException(java.io.IOException) Analyzer(org.jacoco.core.analysis.Analyzer) File(java.io.File)

Aggregations

CoverageBuilder (org.jacoco.core.analysis.CoverageBuilder)16 Analyzer (org.jacoco.core.analysis.Analyzer)13 File (java.io.File)8 ISourceFileCoverage (org.jacoco.core.analysis.ISourceFileCoverage)3 IOException (java.io.IOException)2 InputStream (java.io.InputStream)2 IBundleCoverage (org.jacoco.core.analysis.IBundleCoverage)2 IClassCoverage (org.jacoco.core.analysis.IClassCoverage)2 ExecutionDataStore (org.jacoco.core.data.ExecutionDataStore)2 SessionInfoStore (org.jacoco.core.data.SessionInfoStore)2 RuntimeData (org.jacoco.core.runtime.RuntimeData)2 InputFile (org.sonar.api.batch.fs.InputFile)2 Resource (org.apache.tools.ant.types.Resource)1 FileResource (org.apache.tools.ant.types.resources.FileResource)1 IMethodCoverage (org.jacoco.core.analysis.IMethodCoverage)1 ExecutionData (org.jacoco.core.data.ExecutionData)1 Instrumenter (org.jacoco.core.instr.Instrumenter)1 IRuntime (org.jacoco.core.runtime.IRuntime)1 LoggerRuntime (org.jacoco.core.runtime.LoggerRuntime)1 Test (org.junit.Test)1