Skip to content

Commit

Permalink
Setup running native tests in release mode
Browse files Browse the repository at this point in the history
  • Loading branch information
whyoleg committed May 9, 2024
1 parent 5aa1032 commit 8bdfbee
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
10 changes: 10 additions & 0 deletions buildSrc/src/main/kotlin/native-targets-conventions.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import org.jetbrains.kotlin.gradle.*
import org.jetbrains.kotlin.gradle.plugin.mpp.*

/*
* Copyright 2017-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
Expand Down Expand Up @@ -47,6 +48,15 @@ kotlin {
linuxArm32Hfp()
}

// setup tests running in RELEASE mode
targets.withType<KotlinNativeTarget>().configureEach {
binaries.test(listOf(NativeBuildType.RELEASE))
}
targets.withType<KotlinNativeTargetWithTests<*>>().configureEach {
testRuns.create("releaseTest") {
setExecutionSourceFrom(binaries.getTest(NativeBuildType.RELEASE))
}
}
}

fun doesNotDependOnOkio(project: Project): Boolean {
Expand Down
11 changes: 11 additions & 0 deletions integration-test/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*/
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension
import org.jetbrains.kotlin.gradle.targets.js.npm.tasks.KotlinNpmInstallTask
import org.jetbrains.kotlin.gradle.plugin.mpp.*

val serialization_version = property("mainLibVersion") as String

Expand Down Expand Up @@ -130,6 +131,16 @@ kotlin {
allWarningsAsErrors = true
}
}

// setup tests running in RELEASE mode
targets.withType<KotlinNativeTarget>().configureEach {
binaries.test(listOf(NativeBuildType.RELEASE))
}
targets.withType<KotlinNativeTargetWithTests<*>>().configureEach {
testRuns.create("releaseTest") {
setExecutionSourceFrom(binaries.getTest(NativeBuildType.RELEASE))
}
}
}

dependencies {
Expand Down

0 comments on commit 8bdfbee

Please sign in to comment.