diff --git a/native/native.tests/build.gradle.kts b/native/native.tests/build.gradle.kts index dce98d9c342..2f41a7eb9af 100644 --- a/native/native.tests/build.gradle.kts +++ b/native/native.tests/build.gradle.kts @@ -53,7 +53,6 @@ val stdlibK2Test = nativeTest("stdlibK2Test", "stdlibK2") val kotlinTestLibraryTest = nativeTest("kotlinTestLibraryTest", "kotlin-test") val kotlinTestK2LibraryTest = nativeTest("kotlinTestK2LibraryTest", "kotlin-testK2") val partialLinkageTest = nativeTest("partialLinkageTest", "partial-linkage") -val klibBinaryCompatibilityTest = nativeTest("klibBinaryCompatibilityTest", "klib-binary-compatibility") val cinteropTest = nativeTest("cinteropTest", "cinterop") val debuggerTest = nativeTest("debuggerTest", "debugger") val cachesTest = nativeTest("cachesTest", "caches") diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/KlibBinaryCompatibilityTestGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeKlibEvolutionTestGenerated.java similarity index 98% rename from native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/KlibBinaryCompatibilityTestGenerated.java rename to native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeKlibEvolutionTestGenerated.java index 7af3ced1453..8eb0f1b414b 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/KlibBinaryCompatibilityTestGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeKlibEvolutionTestGenerated.java @@ -7,7 +7,6 @@ package org.jetbrains.kotlin.konan.blackboxtest; import com.intellij.testFramework.TestDataPath; import org.jetbrains.kotlin.test.util.KtTestUtil; -import org.junit.jupiter.api.Tag; import org.jetbrains.kotlin.test.TestMetadata; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; @@ -19,8 +18,7 @@ import java.util.regex.Pattern; @SuppressWarnings("all") @TestMetadata("compiler/testData/binaryCompatibility/klibEvolution") @TestDataPath("$PROJECT_ROOT") -@Tag("k1KlibCompatibility") -public class KlibBinaryCompatibilityTestGenerated extends AbstractNativeKlibBinaryCompatibilityTest { +public class NativeKlibEvolutionTestGenerated extends AbstractNativeKlibEvolutionTest { @Test @TestMetadata("addAbstractMemberBody.kt") public void testAddAbstractMemberBody() throws Exception { diff --git a/native/native.tests/tests/org/jetbrains/kotlin/generators/tests/GenerateNativeTests.kt b/native/native.tests/tests/org/jetbrains/kotlin/generators/tests/GenerateNativeTests.kt index 0758842f101..17440b431bb 100644 --- a/native/native.tests/tests/org/jetbrains/kotlin/generators/tests/GenerateNativeTests.kt +++ b/native/native.tests/tests/org/jetbrains/kotlin/generators/tests/GenerateNativeTests.kt @@ -68,11 +68,10 @@ fun main() { } } - // KLIB binary compatibility tests. + // KLIB evolution tests. testGroup("native/native.tests/tests-gen", "compiler/testData") { - testClass( - suiteTestClassName = "KlibBinaryCompatibilityTestGenerated", - annotations = listOf(k1KLibCompatibility()) + testClass( + suiteTestClassName = "NativeKlibEvolutionTestGenerated" ) { model("binaryCompatibility/klibEvolution", recursive = false) } @@ -163,4 +162,3 @@ private fun k1Infrastructure() = annotation(Tag::class.java, "k1Infrastructure") private fun k1libContents() = annotation(Tag::class.java, "k1libContents") private fun k2libContents() = annotation(Tag::class.java, "k2libContents") private fun firKLibContents() = annotation(Tag::class.java, "firKlibContents") -private fun k1KLibCompatibility() = annotation(Tag::class.java, "k1KlibCompatibility") diff --git a/native/native.tests/tests/org/jetbrains/kotlin/konan/blackboxtest/AbstractNativeKlibBinaryCompatibilityTest.kt b/native/native.tests/tests/org/jetbrains/kotlin/konan/blackboxtest/AbstractNativeKlibEvolutionTest.kt similarity index 94% rename from native/native.tests/tests/org/jetbrains/kotlin/konan/blackboxtest/AbstractNativeKlibBinaryCompatibilityTest.kt rename to native/native.tests/tests/org/jetbrains/kotlin/konan/blackboxtest/AbstractNativeKlibEvolutionTest.kt index e5a87267def..0e0adc72fb7 100644 --- a/native/native.tests/tests/org/jetbrains/kotlin/konan/blackboxtest/AbstractNativeKlibBinaryCompatibilityTest.kt +++ b/native/native.tests/tests/org/jetbrains/kotlin/konan/blackboxtest/AbstractNativeKlibEvolutionTest.kt @@ -25,11 +25,11 @@ import org.jetbrains.kotlin.utils.DFS import org.junit.jupiter.api.Tag import java.io.File import kotlin.math.max -import org.jetbrains.kotlin.compatibility.binary.TestFile as BinaryCompatibilityTestFile -import org.jetbrains.kotlin.compatibility.binary.TestModule as BinaryCompatibilityTestModule +import org.jetbrains.kotlin.compatibility.binary.TestFile as TFile +import org.jetbrains.kotlin.compatibility.binary.TestModule as TModule -@Tag("klib-binary-compatibility") -abstract class AbstractNativeKlibBinaryCompatibilityTest : AbstractNativeSimpleTest() { +@Tag("klib-evolution") +abstract class AbstractNativeKlibEvolutionTest : AbstractNativeSimpleTest() { protected fun runTest(@TestDataFile testPath: String): Unit = AbstractKlibBinaryCompatibilityTest.doTest( filePath = testPath, @@ -39,12 +39,12 @@ abstract class AbstractNativeKlibBinaryCompatibilityTest : AbstractNativeSimpleT ) private fun buildKlib( - binaryCompatibilityTestModule: BinaryCompatibilityTestModule, + testModule: TModule, version: Int ) { - val module = binaryCompatibilityTestModule.toLightDependencyWithVersion(version) + val module = testModule.toLightDependencyWithVersion(version) val moduleDependencies = collectDependencies( - binaryCompatibilityTestModule.dependenciesSymbols, + testModule.dependenciesSymbols, withVersion = version ) val klibFile = module.klibFile @@ -65,7 +65,7 @@ abstract class AbstractNativeKlibBinaryCompatibilityTest : AbstractNativeSimpleT } private fun buildAndExecuteBinary( - mainTestModule: BinaryCompatibilityTestModule, + mainTestModule: TModule, expectedResult: String ) { val binaryVersion = moduleVersions.values.maxOrNull() ?: 2 @@ -224,7 +224,7 @@ abstract class AbstractNativeKlibBinaryCompatibilityTest : AbstractNativeSimpleT } } - private fun BinaryCompatibilityTestFile.toUncommittedIn( + private fun TFile.toUncommittedIn( extra: LightDependencyWithVersion ): TestFile = TestFile.createUncommitted( location = extra.localBuildDir.resolve(name), @@ -232,7 +232,7 @@ abstract class AbstractNativeKlibBinaryCompatibilityTest : AbstractNativeSimpleT text = content ) - private fun BinaryCompatibilityTestModule.toLightDependencyWithVersion( + private fun TModule.toLightDependencyWithVersion( version: Int ): LightDependencyWithVersion { val extra = LightDependencyWithVersion(name, version)