-package org.simantics.scl.compiler.module.coverage;\r
-\r
-import java.io.PrintStream;\r
-import java.util.Arrays;\r
-\r
-import gnu.trove.map.hash.THashMap;\r
-\r
-public class ModuleCoverage extends AbstractCoverage {\r
- \r
- public final THashMap<String, FunctionCoverage> functionCoverages;\r
- \r
- public final int totalFunctionCount;\r
- public final int coveredFunctionCount;\r
- public final double functionCoverage;\r
- \r
- public ModuleCoverage(String moduleName, THashMap<String, FunctionCoverage> functionCoverages,\r
- int totalCodeSize, int coveredCodeSize,\r
- int totalFunctionCount, int coveredFunctionCount) {\r
- \r
- super(moduleName, totalCodeSize, coveredCodeSize);\r
- this.functionCoverages = functionCoverages;\r
- this.totalFunctionCount = totalFunctionCount;\r
- this.coveredFunctionCount = coveredFunctionCount;\r
- this.functionCoverage = CoverageUtils.safeDiv(coveredFunctionCount, totalFunctionCount);\r
- }\r
- \r
- public void print(PrintStream s) {\r
- s.println("Code coverage: " + toPercent(getCoverage()) +\r
- " (" + getCoveredCodeSize() + " / " + getTotalCodeSize() + ")"); \r
- s.println("Function coverage: " + toPercent(functionCoverage) +\r
- " (" + coveredFunctionCount + " / " + totalFunctionCount + ")");\r
- String[] functionNames = functionCoverages.keySet().toArray(new String[functionCoverages.size()]);\r
- Arrays.sort(functionNames);\r
- for(String functionName : functionNames) {\r
- FunctionCoverage fCov = functionCoverages.get(functionName);\r
- s.println(" " + functionName + ": " + toPercent(fCov.getCoverage()) +\r
- " (" + fCov.coveredCodeSize + " / " + fCov.totalCodeSize + ")");\r
- } \r
- }\r
-\r
-}\r
+package org.simantics.scl.compiler.module.coverage;
+
+import java.io.PrintStream;
+import java.util.Arrays;
+
+import gnu.trove.map.hash.THashMap;
+
+public class ModuleCoverage extends AbstractCoverage {
+
+ public final THashMap<String, FunctionCoverage> functionCoverages;
+
+ public final int totalFunctionCount;
+ public final int coveredFunctionCount;
+ public final double functionCoverage;
+
+ public ModuleCoverage(String moduleName, THashMap<String, FunctionCoverage> functionCoverages,
+ int totalCodeSize, int coveredCodeSize,
+ int totalFunctionCount, int coveredFunctionCount) {
+
+ super(moduleName, totalCodeSize, coveredCodeSize);
+ this.functionCoverages = functionCoverages;
+ this.totalFunctionCount = totalFunctionCount;
+ this.coveredFunctionCount = coveredFunctionCount;
+ this.functionCoverage = CoverageUtils.safeDiv(coveredFunctionCount, totalFunctionCount);
+ }
+
+ public void print(PrintStream s) {
+ s.println("Code coverage: " + toPercent(getCoverage()) +
+ " (" + getCoveredCodeSize() + " / " + getTotalCodeSize() + ")");
+ s.println("Function coverage: " + toPercent(functionCoverage) +
+ " (" + coveredFunctionCount + " / " + totalFunctionCount + ")");
+ String[] functionNames = functionCoverages.keySet().toArray(new String[functionCoverages.size()]);
+ Arrays.sort(functionNames);
+ for(String functionName : functionNames) {
+ FunctionCoverage fCov = functionCoverages.get(functionName);
+ s.println(" " + functionName + ": " + toPercent(fCov.getCoverage()) +
+ " (" + fCov.coveredCodeSize + " / " + fCov.totalCodeSize + ")");
+ }
+ }
+
+}