[Native][tests] Rename KLIB binary compatibility tests to KLIB evolution tests

This commit is contained in:
Dmitriy Dolovov
2023-03-31 16:28:27 +02:00
committed by Space Team
parent 49beec33b4
commit 3506e0c20f
4 changed files with 14 additions and 19 deletions
-1
View File
@@ -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")
@@ -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 {
@@ -68,11 +68,10 @@ fun main() {
}
}
// KLIB binary compatibility tests.
// KLIB evolution tests.
testGroup("native/native.tests/tests-gen", "compiler/testData") {
testClass<AbstractNativeKlibBinaryCompatibilityTest>(
suiteTestClassName = "KlibBinaryCompatibilityTestGenerated",
annotations = listOf(k1KLibCompatibility())
testClass<AbstractNativeKlibEvolutionTest>(
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")
@@ -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<TestModule.Exclusive> = 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)