Skip to content

Instantly share code, notes, and snippets.

Created June 11, 2014 16:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/719a681b38bab8d8360b to your computer and use it in GitHub Desktop.
Save anonymous/719a681b38bab8d8360b to your computer and use it in GitHub Desktop.
JacocoTestReport not working in 2.0-rc-1
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'
}
public class MyObject {
public void myMethod() {
for (int i = 0; i < 5; i++) {
System.out.println("this should be covered");
}
}
}
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