Multiplatform Testing
In Kotlin Multiplatform projects, Kreate configures two distinct categories of test tasks separately, because they are implemented by different Gradle task types with different APIs.
Task Types
Task Type | Kotlin Plugin | Targets | Configured By |
|---|---|---|---|
|
| JVM targets |
|
|
| Native, JS targets |
|
Both task types receive the same timeout, ignoreFailures, failOnNoDiscoveredTests, alwaysRunTests, logging, and report settings. Only maxParallelForks and useJUnitPlatform() are exclusive to JVM Test tasks.
JVM Target
For the JVM target in a multiplatform project, Kreate configures Test tasks identically to a pure Kotlin JVM project: useJUnitPlatform() is applied, and maxParallelForks takes effect.
Write JVM-specific tests in jvmTest/kotlin/:
Run with:
Native Targets
For native targets (e.g., linuxX64, macosArm64, mingwX64), Kreate configures KotlinTest tasks. These tasks do not use the JUnit Platform — the Kotlin/Native test runner is embedded directly in the compiled binary.
Write shared tests in commonTest/kotlin/:
Run native tests with:
Configuration Scope
All settings from tests { } apply uniformly to every test task across all targets. There is currently no per-target override mechanism within the tests { } block — if you need target-specific test task configuration, use the standard Kotlin Multiplatform DSL directly: