From a9d13338bd5cfde3df5fb4b71327a0c06e39eab8 Mon Sep 17 00:00:00 2001 From: Sergey Bogolepov Date: Thu, 12 Jan 2023 13:16:28 +0200 Subject: [PATCH] [K/N] Make AbstractNativeCInteropTest a bit more flexible It probably requires a bit more thoughful refactoring, but before that we need to collect more test-cases. --- .../konan/blackboxtest/AbstractNativeCInteropTest.kt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/native/native.tests/tests/org/jetbrains/kotlin/konan/blackboxtest/AbstractNativeCInteropTest.kt b/native/native.tests/tests/org/jetbrains/kotlin/konan/blackboxtest/AbstractNativeCInteropTest.kt index 66f4be04fbf..9af81ed2e77 100644 --- a/native/native.tests/tests/org/jetbrains/kotlin/konan/blackboxtest/AbstractNativeCInteropTest.kt +++ b/native/native.tests/tests/org/jetbrains/kotlin/konan/blackboxtest/AbstractNativeCInteropTest.kt @@ -25,16 +25,22 @@ import java.io.File abstract class AbstractNativeCInteropFModulesTest : AbstractNativeCInteropTest() { override val fmodules = true + + override val defFileName: String = "pod1.def" } abstract class AbstractNativeCInteropNoFModulesTest : AbstractNativeCInteropTest() { override val fmodules = false + + override val defFileName: String = "pod1.def" } @Tag("cinterop") abstract class AbstractNativeCInteropTest : AbstractNativeCInteropBaseTest() { abstract val fmodules: Boolean + abstract val defFileName: String + @Synchronized protected fun runTest(@TestDataFile testPath: String) { // FIXME: check the following failures under Android with -fmodules @@ -46,7 +52,7 @@ abstract class AbstractNativeCInteropTest : AbstractNativeCInteropBaseTest() { val testPathFull = getAbsoluteFile(testPath) val testDataDir = testPathFull.parentFile.parentFile val includeFolder = testDataDir.resolve("include") - val defFile = testPathFull.resolve("pod1.def") + val defFile = testPathFull.resolve(defFileName) val defContents = defFile.readText().split("\n").map { it.trim() } val defHasObjC = defContents.any { it.endsWith("Objective-C") } Assumptions.assumeFalse(defHasObjC && !targets.testTarget.family.isAppleFamily)