Kover is a set of solutions for collecting test coverage of Kotlin code compiled for JVM and Android platforms.
Kover Toolset:
For full information about latest stable release of Kover Gradle Plugin, please refer to the documentation.
JVM
tests (JS and native targets are not supported yet).HTML
and XML
reports.Kotlin JVM
, Kotlin Multiplatform
projects.Kotlin Android
projects with build variants (instrumentation tests executing on the Android device are not supported yet).Kotlin
and Java
sourcesThe recommended way of applying Kover is with the plugins DSL.
Minimum supported version of Gradle
is 6.8
.
Add the following to your top-level build file:
Kotlinplugins { id("org.jetbrains.kotlinx.kover") version "0.9.1" }Groovy
plugins { id 'org.jetbrains.kotlinx.kover' version '0.9.1' }
After you applied Kover Gradle plugin, Kover tasks will be created for generating reports and verification. E.g. to generate HTML report run ./gradlew koverHtmlReport
- this will automatically start code compilation, execution of instrumented tests, and an HTML report will be generated with measurement results in the build folder.
It is also important that after applying Kover Gradle plugin, during the running tests, the classes are modified (instrumented) when loaded into the JVM which may lead to some performance degradation, or affect concurrent tests.
Legacy Plugin ApplicationLegacy method of applying plugins can be used if you cannot use the plugins DSL for some reason.
Kotlinbuildscript { repositories { mavenCentral() } dependencies { classpath("org.jetbrains.kotlinx:kover-gradle-plugin:0.9.1") } } apply(plugin = "org.jetbrains.kotlinx.kover")Groovy
buildscript { repositories { mavenCentral() } dependencies { classpath 'org.jetbrains.kotlinx:kover-gradle-plugin:0.9.1' } } apply plugin: 'org.jetbrains.kotlinx.kover'To create report combining coverage info from different Gradle projects
You have to add dependency on the project, in which the report task will be run
dependencies { kover(project(":another:project")) }
in this case report will be generated for current project joined with :another:project
project.
More examples of Gradle plugin applying can be found in example folder
Kover Aggregated Plugin as a prototype of Gradle Settings plugin, created to simplify the setup of multi-project builds. It is in its infancy, it is recommended to use it only for test or pet projects.
Refer to the documentation for details.
The Kover Maven Plugin can be applied by specifying build plugin
<plugin> <groupId>org.jetbrains.kotlinx</groupId> <artifactId>kover-maven-plugin</artifactId> <version>0.9.1</version> </plugin>
The list of Kover goals is specified in this document section.
For full information about latest stable release of Kover Maven Plugin, please refer to the documentation.
Standalone JVM application used for offline instrumentation and generation of human-readable reports.
Documentation of the Kover CLI.
Kover offline instrumentationOffline instrumentation is the modification of class-files stored on disk to measure their coverage.
The ways of offline instrumentation and running of the instrumented applications are described in the documentation.
JVM agent is a jar file that modifies the bytecode of loaded into the JVM classes in order to measure coverage. Documentations.
A JVM dependency that allows to programmatically instrument class-files on a disk.
Documentation of Kover features artifact
Building locally and ContributingRetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4