use of eu.stamp.project.testrunner.runner.coverage.Coverage in project dspot by STAMP-project.
the class CloverCoverageSelector method report.
@Override
public void report() {
final Coverage amplifiedCoverage = computeAmplifiedCoverage();
final String nl = System.getProperty("line.separator");
final StringBuilder report = new StringBuilder();
report.append("======= REPORT =======").append(nl);
report.append("Initial Coverage: ").append(this.initialCoverage.toString()).append(nl);
report.append("The amplification results with: ").append(this.selectedAmplifiedTest.size()).append(" amplified test cases").append(nl);
report.append("Amplified Coverage: ").append(amplifiedCoverage.toString()).append(nl);
System.out.println(report.toString());
File reportDir = new File(this.configuration.getOutputDirectory());
if (!reportDir.exists()) {
reportDir.mkdir();
}
if (this.currentClassTestToBeAmplified != null) {
try (FileWriter writer = new FileWriter(this.configuration.getOutputDirectory() + "/" + this.currentClassTestToBeAmplified.getQualifiedName() + "_clover_coverage.txt", false)) {
writer.write(report.toString());
} catch (IOException e) {
throw new RuntimeException(e);
}
}
this.currentClassTestToBeAmplified = null;
}
Aggregations