Added project property to enable test coverage.
This commit is contained in:
parent
2c219f7a66
commit
5fe589e360
|
@ -29,13 +29,15 @@ task emmaInstrument {
|
|||
|
||||
// Modify test tasks in the project to generate coverage data
|
||||
afterEvaluate {
|
||||
tasks.withType(Test.class).each { task ->
|
||||
task.dependsOn emmaInstrument
|
||||
task.configure() {
|
||||
jvmArgs "-Demma.coverage.out.file=$emmaMetaDataFile", "-Demma.coverage.out.merge=true"
|
||||
}
|
||||
task.doFirst {
|
||||
setClasspath(files("$buildDir/emma/classes") + configurations.emma + getClasspath())
|
||||
if (project.hasProperty('coverage') && ['on','true'].contains(project.properties.coverage)) {
|
||||
tasks.withType(Test.class).each { task ->
|
||||
task.dependsOn emmaInstrument
|
||||
task.configure() {
|
||||
jvmArgs "-Demma.coverage.out.file=$emmaMetaDataFile", "-Demma.coverage.out.merge=true"
|
||||
}
|
||||
task.doFirst {
|
||||
setClasspath(files("$buildDir/emma/classes") + configurations.emma + getClasspath())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue