[Native][tests] Optionally, run tests with the dependency on K/N platform libs

This commit is contained in:
mvicsokolova
2022-10-21 02:07:00 +02:00
committed by Space Team
parent fbfb564b41
commit e7f2e2cccb
+8 -1
View File
@@ -74,6 +74,7 @@ private fun Test.ComputedTestProperties(init: ComputedTestProperties.() -> Unit)
fun Project.nativeTest(
taskName: String,
tag: String?,
requirePlatformLibs: Boolean = false,
customDependencies: List<Configuration> = emptyList(),
customKlibDependencies: List<Configuration> = emptyList()
) = projectTest(
@@ -113,7 +114,13 @@ fun Project.nativeTest(
val computedTestProperties = ComputedTestProperties {
compute(KOTLIN_NATIVE_HOME) {
val testTarget = readFromGradle(TEST_TARGET)
dependsOn(if (testTarget != null) ":kotlin-native:${testTarget}CrossDist" else ":kotlin-native:dist")
if (testTarget != null) {
dependsOn(":kotlin-native:${testTarget}CrossDist")
if (requirePlatformLibs) dependsOn(":kotlin-native:${testTarget}PlatformLibs")
} else {
dependsOn(":kotlin-native:dist")
if (requirePlatformLibs) dependsOn(":kotlin-native:distPlatformLibs")
}
project(":kotlin-native").projectDir.resolve("dist").absolutePath
}