aboutsummaryrefslogtreecommitdiff
path: root/all
diff options
context:
space:
mode:
authorEric Anderson <ejona@google.com>2015-05-05 12:29:26 -0700
committerEric Anderson <ejona@google.com>2015-05-05 14:36:00 -0700
commit041cdb11ed5889becbfaa08b00a7b247bb9700b2 (patch)
treeecc2878434d10554669a57db1391085852fe7681 /all
parentcde7eaa585979a23000d24f574cf9d2c0247b112 (diff)
downloadgrpc-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.gradle15
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)
+}