mirror of https://github.com/grpc/grpc-java.git
Add Jacoco code coverage
After running tests, you can run jacocoTestReport. The jacocoTestReport task does not depend on the tests, so they should be run separately. There is still a lot of noise in the jacoco output since we aren't yet filtering generated code.
This commit is contained in:
parent
cde7eaa585
commit
041cdb11ed
|
@ -41,3 +41,18 @@ javadoc {
|
|||
options.links subproject.javadoc.options.links.toArray(new String[0])
|
||||
}
|
||||
}
|
||||
|
||||
task jacocoMerge(type: JacocoMerge) {
|
||||
destinationFile = file("${buildDir}/jacoco/test.exec")
|
||||
executionData = files(rootProject.subprojects.jacocoTestReport.executionData)
|
||||
.minus(files("${buildDir}/jacoco/test.exec"))
|
||||
.filter { f -> f.exists() }
|
||||
}
|
||||
|
||||
jacocoTestReport {
|
||||
dependsOn(jacocoMerge)
|
||||
|
||||
additionalSourceDirs = files(rootProject.subprojects.sourceSets.main.allSource.srcDirs)
|
||||
sourceDirectories = files(rootProject.subprojects.sourceSets.main.allSource.srcDirs)
|
||||
classDirectories = files(rootProject.subprojects.sourceSets.main.output)
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@ subprojects {
|
|||
apply plugin: "idea"
|
||||
apply plugin: "osdetector"
|
||||
apply plugin: "signing"
|
||||
apply plugin: "jacoco"
|
||||
|
||||
group = "io.grpc"
|
||||
version = "0.1.0-SNAPSHOT"
|
||||
|
|
Loading…
Reference in New Issue