Skip to content

Latest commit

 

History

History
57 lines (43 loc) · 1.01 KB

File metadata and controls

57 lines (43 loc) · 1.01 KB
id title sidebar_label slug
jacoco
Jacoco
Jacoco
jacoco.html

Kotest integrates with Jacoco for code coverage in the standard gradle way. You can read gradle installation instructions here.

  1. In gradle, add jacoco to your plugins.
plugins {
   ...
   jacoco
   ...
}
  1. Configure jacoco
jacoco {
    toolVersion = "0.8.7"
    reportsDirectory = layout.buildDirectory.dir('customJacocoReportDir') // optional
}
  1. Add the jacoco XML report task.
tasks.jacocoTestReport {
    dependsOn(tasks.test)
    reports {
        xml.required.set(true)
    }
}
  1. Change tests task to depend on jacoco.
tasks.test {
  ...
  finalizedBy(tasks.jacocoTestReport)
}

Now when you run test, the Jacoco report files should be generated in $buildDir/reports/jacoco.

:::note You may need to apply the jacoco plugin to each submodule if you have a multi module project. :::