kevin.cianfarini
01/08/2025, 6:14 PMXCTest
Gradle task, but it doesn’t provide functionality like the Test
task. Eg.
tasks.withType<Test> {
exclude("**/acceptance/**")
}
jw
01/08/2025, 6:19 PMexpect fun isIos(): Boolean
// In your test:
if (isIos()) return
non-native:
actual fun isIos(): Boolean = false
native:
actual fun isIos(): Boolean = Platform.osFamily == OsFamily.IOS
kevin.cianfarini
01/08/2025, 6:22 PMkevin.cianfarini
01/08/2025, 6:22 PMephemient
01/08/2025, 6:24 PMtasks.withType<KotlinNativeTest>().configureEach {
args += "--ktest_negative_gradle_filter=*acceptance*"
}
kevin.cianfarini
01/08/2025, 6:42 PMrusshwolf
01/08/2025, 7:01 PMexpect annotation class IosIgnore
with actual typealias IosIgnore = kotlin.test.Ignore
on iOS and no-op on other platformskevin.cianfarini
01/08/2025, 7:13 PMephemient
01/08/2025, 7:25 PM// build.gradle.kts
kotlin {
applyDefaultHierarchyTemplate {
common {
group("nonIos") {
withJs()
withJvm()
withAndroidNative()
withMacos()
withLinux()
withMingw()
withAndroidTarget()
withWasmJs()
withWasmWasi()
(of course you could trim that down to the targets you actually use) and then tests in src/nonIosTest/kotlin/**
simply won't exist on iOS