Skip to content
This repository has been archived by the owner on Sep 26, 2019. It is now read-only.

[minor] include reference tests in jacoco #1024

Merged
merged 1 commit into from
Mar 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,12 @@ allprojects {

version = rootProject.version

jacoco { toolVersion = '0.8.2' }
jacoco {
toolVersion = '0.8.2'
if (project.tasks.findByName('referenceTests')) {
applyTo referenceTests
}
}

sourceCompatibility = '1.8'
targetCompatibility = '1.8'
Expand Down Expand Up @@ -389,16 +394,13 @@ task jacocoRootReport(type: org.gradle.testing.jacoco.tasks.JacocoReport) {
additionalSourceDirs.from files(subprojects.sourceSets.main.allSource.srcDirs)
sourceDirectories.from files(subprojects.sourceSets.main.allSource.srcDirs)
classDirectories.from files(subprojects.sourceSets.main.output)
executionData.from files(subprojects.jacocoTestReport.executionData) //how to exclude some package/classes com.test.**
executionData.from fileTree(dir: '.', includes: ['**/jacoco/*.exec'])
reports {
xml.enabled true
csv.enabled true
html.destination file("build/reports/jacocoHtml")
}
onlyIf = { true }
doFirst {
executionData = files(executionData.findAll { it.exists() })
}
}

configurations { annotationProcessor }
Expand Down
2 changes: 1 addition & 1 deletion docs/development/code-coverage.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ We use the jacoco test coverage plugin, which will generate coverage data whenev

To run the report:
```
./gradlew test jacocoTestReport
./gradlew test jacocoTestReport jacocoRootReport
```

The report will be available at `build/reports/jacoco/test/html/index.html`