Created
June 11, 2014 16:12
-
-
Save anonymous/719a681b38bab8d8360b to your computer and use it in GitHub Desktop.
JacocoTestReport not working in 2.0-rc-1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apply plugin: 'java' | |
apply plugin: 'jacoco' | |
test.jacoco.destinationFile = file("$buildDir/tmp/jacoco/jacoco.exec") | |
test.jacoco.append = false | |
jacocoTestReport { | |
reports { | |
xml.enabled false | |
csv.enabled false | |
html.destination "${buildDir}/reports/jacoco" | |
} | |
additionalSourceDirs = files(sourceSets.main.allJava.srcDirs) | |
} | |
jacoco { toolVersion = "0.7.1.201405082137" } | |
repositories { | |
mavenCentral() | |
} | |
dependencies { | |
compile 'junit:junit:4.11' | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MyObject { | |
public void myMethod() { | |
for (int i = 0; i < 5; i++) { | |
System.out.println("this should be covered"); | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.junit.Test; | |
public class MyObjectTest { | |
@Test | |
public void myTest() { | |
new MyObject().myMethod(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment