[minor] include reference tests in jacoco (#1024)

As previously configured reference tests were not included in jacaoco
results, implying vast swaths of the EVM were not tested.  By adding
jacoco to the reference tests and including them in the report a more
accurate picture of line level testing results.
Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
pull/2/head
Danno Ferrin 6 years ago committed by GitHub
parent 764ab3c11e
commit 0cbec8dbb1
  1. 12
      build.gradle
  2. 2
      docs/development/code-coverage.md

@ -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'
@ -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 }

@ -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`
Loading…
Cancel
Save