diff options
author | Eric Anderson <ejona@google.com> | 2015-05-05 12:29:26 -0700 |
---|---|---|
committer | Eric Anderson <ejona@google.com> | 2015-05-05 14:36:00 -0700 |
commit | 041cdb11ed5889becbfaa08b00a7b247bb9700b2 (patch) | |
tree | ecc2878434d10554669a57db1391085852fe7681 /all | |
parent | cde7eaa585979a23000d24f574cf9d2c0247b112 (diff) | |
download | grpc-grpc-java-041cdb11ed5889becbfaa08b00a7b247bb9700b2.tar.gz |
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.
Diffstat (limited to 'all')
-rw-r--r-- | all/build.gradle | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/all/build.gradle b/all/build.gradle index 62d648a84..b84a6bcb7 100644 --- a/all/build.gradle +++ b/all/build.gradle @@ -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) +} |