summaryrefslogtreecommitdiffstats
path: root/Tests/CoberturaCoverage/src
diff options
context:
space:
mode:
authorJoseph Snyder <joe.snyder@kitware.com>2014-05-29 17:47:31 (GMT)
committerJoseph Snyder <joe.snyder@kitware.com>2014-06-04 14:26:19 (GMT)
commit50daf239b001ddda61449044e75bb98651e99d21 (patch)
treece47d4d773037e2515149de475c7edeee6baff17 /Tests/CoberturaCoverage/src
parenta2822d30899f3fc2ad96abfdf5de0d0ce4166139 (diff)
downloadCMake-50daf239b001ddda61449044e75bb98651e99d21.zip
CMake-50daf239b001ddda61449044e75bb98651e99d21.tar.gz
CMake-50daf239b001ddda61449044e75bb98651e99d21.tar.bz2
CTest: Generalize Cobertura coverage format handling
Add support for Cobertura coverage files written by Java. Add a test which uses the report from a Java run of Cobertura to calculate coverage. In the documentation of CTEST_COVERAGE_COMMAND, give a sample .sh file to merge the Cobertura .ser files and generate the XML report from the merged file.
Diffstat (limited to 'Tests/CoberturaCoverage/src')
-rw-r--r--Tests/CoberturaCoverage/src/main/java/org/cmake/CoverageTest.java52
1 files changed, 52 insertions, 0 deletions
diff --git a/Tests/CoberturaCoverage/src/main/java/org/cmake/CoverageTest.java b/Tests/CoberturaCoverage/src/main/java/org/cmake/CoverageTest.java
new file mode 100644
index 0000000..4fb43c6
--- /dev/null
+++ b/Tests/CoberturaCoverage/src/main/java/org/cmake/CoverageTest.java
@@ -0,0 +1,52 @@
+package org.cmake.Coverage;
+
+import java.io.Serializable;
+import java.util.Map;
+import java.util.List;
+import java.awt.*;
+
+public class CoverageTest {
+
+ public static String VarOne = "test1";
+ public static String VarTwo = "test2";
+ private Integer IntOne = 4;
+
+ public static Boolean equalsVarOne(String inString) {
+
+ if(VarOne.equals(inString)){
+ return true;
+ }
+ else {
+ return false;
+ }
+ }
+
+ public static boolean equalsVarTwo(String inString){
+
+ if(VarTwo.equals(inString)){
+ return true;
+ }
+ else {
+ return false;
+ }
+ }
+
+ private Integer timesIntOne(Integer inVal){
+
+ return inVal * IntOne;
+ }
+
+ public static boolean whileLoop(Integer StopInt){
+
+ Integer i = 0;
+ while(i < StopInt){
+ i=i+1;
+ }
+ if (i.equals(5)){
+ return true;
+ }
+ else {
+ return false;
+ }
+ }
+}