Reputation: 13
I try to use kover
plugin to check test coverage of my kotlin native project.
But when I run koverReport
, below is the log from intellij and nothings generated.
...
> Task :koverHtmlReport SKIPPED
> Task :koverXmlReport SKIPPED
> Task :koverReport UP-TO-DATE
BUILD SUCCESSFUL in 322ms
6:30:48 pm: Execution finished 'koverReport'.
Below was my build.gradle.kts
plugins {
kotlin("multiplatform") version "1.8.21"
id("org.jetbrains.kotlinx.kover") version "0.6.1"
}
...
kotlin {
val hostOs = System.getProperty("os.name")
val isMingwX64 = hostOs.startsWith("Windows")
val nativeTarget = when {
hostOs == "Mac OS X" -> macosX64("native")
hostOs == "Linux" -> linuxX64("native")
isMingwX64 -> mingwX64("native")
else -> throw GradleException("Host OS is not supported in Kotlin/Native.")
}
nativeTarget.apply {
binaries {
executable {
entryPoint = "main"
}
}
}
sourceSets {
val commonMain by getting
val commonTest by getting {
dependencies {
implementation(kotlin("test"))
}
}
val nativeMain by getting
val nativeTest by getting
nativeMain.dependsOn(commonMain)
}
}
Expecting code report is generated but under build/reports
, no kover
directory is found.
Upvotes: 1
Views: 986