[K2/N] Replace K2 prefixes for test classes with Fir

Merge-request: KT-MR-9248
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
This commit is contained in:
Vladimir Sukharev
2023-03-20 10:55:57 +00:00
committed by Space Team
parent 33d13474c5
commit 5ef62c8760
11 changed files with 1848 additions and 632 deletions
@@ -8,7 +8,7 @@ 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.konan.blackboxtest.support.group.K2Pipeline;
import org.jetbrains.kotlin.konan.blackboxtest.support.group.FirPipeline;
import org.jetbrains.kotlin.test.TestMetadata;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
@@ -21,8 +21,9 @@ import java.util.regex.Pattern;
@TestMetadata("native/native.tests/testData/klibContents")
@TestDataPath("$PROJECT_ROOT")
@Tag("k2libContents")
@K2Pipeline()
public class NativeK2LibContentsTestGenerated extends AbstractNativeKlibContentsTest {
@Tag("firKlibContents")
@FirPipeline()
public class FirNativeKLibContentsTestGenerated extends AbstractNativeKlibContentsTest {
@Test
public void testAllFilesPresentInKlibContents() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("native/native.tests/testData/klibContents"), Pattern.compile("^([^_](.+)).kt$"), null, true);
@@ -62,7 +63,8 @@ public class NativeK2LibContentsTestGenerated extends AbstractNativeKlibContents
@TestMetadata("native/native.tests/testData/klibContents/builtinsSerializer")
@TestDataPath("$PROJECT_ROOT")
@Tag("k2libContents")
@K2Pipeline()
@Tag("firKlibContents")
@FirPipeline()
public class BuiltinsSerializer {
@Test
public void testAllFilesPresentInBuiltinsSerializer() throws Exception {
@@ -127,7 +129,8 @@ public class NativeK2LibContentsTestGenerated extends AbstractNativeKlibContents
@TestMetadata("native/native.tests/testData/klibContents/builtinsSerializer/annotationArguments")
@TestDataPath("$PROJECT_ROOT")
@Tag("k2libContents")
@K2Pipeline()
@Tag("firKlibContents")
@FirPipeline()
public class AnnotationArguments {
@Test
public void testAllFilesPresentInAnnotationArguments() throws Exception {
@@ -176,7 +179,8 @@ public class NativeK2LibContentsTestGenerated extends AbstractNativeKlibContents
@TestMetadata("native/native.tests/testData/klibContents/klib")
@TestDataPath("$PROJECT_ROOT")
@Tag("k2libContents")
@K2Pipeline()
@Tag("firKlibContents")
@FirPipeline()
public class Klib {
@Test
public void testAllFilesPresentInKlib() throws Exception {
@@ -18,11 +18,12 @@ import java.util.regex.Pattern;
/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.GenerateNativeTestsKt}. DO NOT MODIFY MANUALLY */
@SuppressWarnings("all")
public class InfrastructureTestGenerated extends AbstractNativeBlackBoxTest {
public class K1InfrastructureTestGenerated extends AbstractNativeBlackBoxTest {
@Nested
@TestMetadata("native/native.tests/testData/samples")
@TestDataPath("$PROJECT_ROOT")
@Tag("infrastructure")
@Tag("k1Infrastructure")
@UseStandardTestCaseGroupProvider()
public class Samples {
@Test
@@ -244,6 +245,7 @@ public class InfrastructureTestGenerated extends AbstractNativeBlackBoxTest {
@TestMetadata("native/native.tests/testData/samples/inner")
@TestDataPath("$PROJECT_ROOT")
@Tag("infrastructure")
@Tag("k1Infrastructure")
@UseStandardTestCaseGroupProvider()
public class Inner {
@Test
@@ -263,6 +265,7 @@ public class InfrastructureTestGenerated extends AbstractNativeBlackBoxTest {
@TestMetadata("native/native.tests/testData/samples2")
@TestDataPath("$PROJECT_ROOT")
@Tag("infrastructure")
@Tag("k1Infrastructure")
@UseStandardTestCaseGroupProvider()
public class Samples2 {
@Test
@@ -7,6 +7,7 @@ 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;
@@ -18,7 +19,8 @@ import java.util.regex.Pattern;
@SuppressWarnings("all")
@TestMetadata("compiler/testData/binaryCompatibility/klibEvolution")
@TestDataPath("$PROJECT_ROOT")
public class KlibBinaryCompatibilityTestGenerated extends AbstractNativeKlibBinaryCompatibilityTest {
@Tag("k1KlibCompatibility")
public class K1KlibBinaryCompatibilityTestGenerated extends AbstractNativeKlibBinaryCompatibilityTest {
@Test
@TestMetadata("addAbstractMemberBody.kt")
public void testAddAbstractMemberBody() throws Exception {
@@ -20,7 +20,7 @@ import java.util.regex.Pattern;
@TestMetadata("native/native.tests/testData/klibContents")
@TestDataPath("$PROJECT_ROOT")
@Tag("k1libContents")
public class NativeK1LibContentsTestGenerated extends AbstractNativeKlibContentsTest {
public class K1NativeKLibContentsTestGenerated extends AbstractNativeKlibContentsTest {
@Test
public void testAllFilesPresentInKlibContents() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("native/native.tests/testData/klibContents"), Pattern.compile("^([^_](.+)).kt$"), null, true);
@@ -11,7 +11,7 @@ import org.jetbrains.kotlin.konan.blackboxtest.*
import org.jetbrains.kotlin.konan.blackboxtest.support.ClassLevelProperty
import org.jetbrains.kotlin.konan.blackboxtest.support.EnforcedHostTarget
import org.jetbrains.kotlin.konan.blackboxtest.support.EnforcedProperty
import org.jetbrains.kotlin.konan.blackboxtest.support.group.K2Pipeline
import org.jetbrains.kotlin.konan.blackboxtest.support.group.FirPipeline
import org.jetbrains.kotlin.konan.blackboxtest.support.group.UseExtTestCaseGroupProvider
import org.jetbrains.kotlin.konan.blackboxtest.support.group.UseStandardTestCaseGroupProvider
import org.jetbrains.kotlin.test.TargetBackend
@@ -24,8 +24,8 @@ fun main() {
// Codegen box tests.
testGroup("native/native.tests/tests-gen", "compiler/testData") {
testClass<AbstractNativeCodegenBoxTest>(
suiteTestClassName = "NativeCodegenBoxTestGenerated",
annotations = listOf(codegen(), provider<UseExtTestCaseGroupProvider>())
suiteTestClassName = "K1NativeCodegenBoxTestGenerated",
annotations = listOf(codegen(), k1Codegen(), provider<UseExtTestCaseGroupProvider>())
) {
model("codegen/box", targetBackend = TargetBackend.NATIVE)
model("codegen/boxInline", targetBackend = TargetBackend.NATIVE)
@@ -34,8 +34,8 @@ fun main() {
testGroup("native/native.tests/tests-gen", "compiler/testData") {
testClass<AbstractNativeCodegenBoxTest>(
suiteTestClassName = "K2NativeCodegenBoxTestGenerated",
annotations = listOf(codegenK2(), provider<UseExtTestCaseGroupProvider>(), provider<K2Pipeline>())
suiteTestClassName = "FirNativeCodegenBoxTestGenerated",
annotations = listOf(codegenK2(), firCodegen(), provider<UseExtTestCaseGroupProvider>(), provider<FirPipeline>())
) {
model("codegen/box", targetBackend = TargetBackend.NATIVE)
model("codegen/boxInline", targetBackend = TargetBackend.NATIVE)
@@ -45,8 +45,8 @@ fun main() {
// Samples (how to utilize the abilities of new test infrastructure).
testGroup("native/native.tests/tests-gen", "native/native.tests/testData") {
testClass<AbstractNativeBlackBoxTest>(
suiteTestClassName = "InfrastructureTestGenerated",
annotations = listOf(infrastructure(), provider<UseStandardTestCaseGroupProvider>())
suiteTestClassName = "K1InfrastructureTestGenerated",
annotations = listOf(infrastructure(), k1Infrastructure(), provider<UseStandardTestCaseGroupProvider>())
) {
model("samples")
model("samples2")
@@ -65,7 +65,8 @@ fun main() {
// KLIB binary compatibility tests.
testGroup("native/native.tests/tests-gen", "compiler/testData") {
testClass<AbstractNativeKlibBinaryCompatibilityTest>(
suiteTestClassName = "KlibBinaryCompatibilityTestGenerated"
suiteTestClassName = "K1KlibBinaryCompatibilityTestGenerated",
annotations = listOf(k1KLibCompatibility())
) {
model("binaryCompatibility/klibEvolution", recursive = false)
}
@@ -104,7 +105,7 @@ fun main() {
// Klib contents tests
testGroup("native/native.tests/tests-gen", "native/native.tests/testData") {
testClass<AbstractNativeKlibContentsTest>(
suiteTestClassName = "NativeK1LibContentsTestGenerated",
suiteTestClassName = "K1NativeKLibContentsTestGenerated",
annotations = listOf(k1libContents())
) {
model("klibContents", pattern = "^([^_](.+)).kt$", recursive = true)
@@ -112,8 +113,8 @@ fun main() {
}
testGroup("native/native.tests/tests-gen", "native/native.tests/testData") {
testClass<AbstractNativeKlibContentsTest>(
suiteTestClassName = "NativeK2LibContentsTestGenerated",
annotations = listOf(k2libContents(), provider<K2Pipeline>())
suiteTestClassName = "FirNativeKLibContentsTestGenerated",
annotations = listOf(k2libContents(), firKLibContents(), provider<FirPipeline>())
) {
model("klibContents", pattern = "^([^_](.+)).kt$", recursive = true)
}
@@ -147,8 +148,13 @@ private fun debugOnly() = annotation(
private fun hostOnly() = provider<EnforcedHostTarget>()
private fun codegen() = annotation(Tag::class.java, "codegen")
private fun k1Codegen() = annotation(Tag::class.java, "k1Codegen")
private fun codegenK2() = annotation(Tag::class.java, "codegenK2")
private fun firCodegen() = annotation(Tag::class.java, "firCodegen")
private fun debugger() = annotation(Tag::class.java, "debugger")
private fun infrastructure() = annotation(Tag::class.java, "infrastructure")
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")
@@ -7,13 +7,14 @@ package org.jetbrains.kotlin.konan.blackboxtest
import org.jetbrains.kotlin.konan.blackboxtest.support.TestCaseId
import org.jetbrains.kotlin.konan.blackboxtest.support.TestRunnerType
import org.jetbrains.kotlin.konan.blackboxtest.support.group.K2Pipeline
import org.jetbrains.kotlin.konan.blackboxtest.support.group.FirPipeline
import org.jetbrains.kotlin.konan.blackboxtest.support.group.PredefinedTestCases
import org.jetbrains.kotlin.konan.blackboxtest.support.group.PredefinedTestCase as TC
import org.junit.jupiter.api.Tag
import org.junit.jupiter.api.TestFactory
@Tag("kotlin-test")
@Tag("k1Kotlin-test")
@PredefinedTestCases(
TC(
name = "default",
@@ -28,7 +29,7 @@ import org.junit.jupiter.api.TestFactory
sourceLocations = ["libraries/kotlin.test/common/src/test/kotlin/**.kt"]
)
)
class KotlinTestLibraryTest : AbstractNativeBlackBoxTest() {
class K1KotlinTestLibraryTest : AbstractNativeBlackBoxTest() {
@TestFactory
fun default() = dynamicTestCase(TestCaseId.Named("default"))
@@ -37,6 +38,7 @@ class KotlinTestLibraryTest : AbstractNativeBlackBoxTest() {
}
@Tag("kotlin-testK2")
@Tag("firKotlin-test")
@PredefinedTestCases(
TC(
name = "default",
@@ -51,8 +53,8 @@ class KotlinTestLibraryTest : AbstractNativeBlackBoxTest() {
sourceLocations = ["libraries/kotlin.test/common/src/test/kotlin/**.kt"]
)
)
@K2Pipeline
class KotlinTestK2LibraryTest : AbstractNativeBlackBoxTest() {
@FirPipeline
class FirKotlinTestLibraryTest : AbstractNativeBlackBoxTest() {
@TestFactory
fun default() = dynamicTestCase(TestCaseId.Named("default"))
@@ -9,7 +9,7 @@ package org.jetbrains.kotlin.konan.blackboxtest
import org.jetbrains.kotlin.konan.blackboxtest.support.TestCaseId
import org.jetbrains.kotlin.konan.blackboxtest.support.TestRunnerType
import org.jetbrains.kotlin.konan.blackboxtest.support.group.K2Pipeline
import org.jetbrains.kotlin.konan.blackboxtest.support.group.FirPipeline
import org.jetbrains.kotlin.konan.blackboxtest.support.group.PredefinedPaths.KOTLIN_NATIVE_DISTRIBUTION
import org.jetbrains.kotlin.konan.blackboxtest.support.group.PredefinedTestCase as TC
import org.jetbrains.kotlin.konan.blackboxtest.support.group.PredefinedTestCases
@@ -54,6 +54,7 @@ class StdlibTest : AbstractNativeBlackBoxTest() {
}
@Tag("stdlibK2")
@Tag("firStdlib")
@PredefinedTestCases(
TC(
name = "default",
@@ -110,8 +111,8 @@ class StdlibTest : AbstractNativeBlackBoxTest() {
ignoredTests = [DISABLED_STDLIB_TEST]
)
)
@K2Pipeline
class StdlibK2Test : AbstractNativeBlackBoxTest() {
@FirPipeline
class FirStdlibTest : AbstractNativeBlackBoxTest() {
@TestFactory
fun default() = dynamicTestCase(TestCaseId.Named("default"))
@@ -11,7 +11,7 @@ import org.jetbrains.kotlin.konan.blackboxtest.support.NativeTestSupport.getOrCr
import org.jetbrains.kotlin.konan.blackboxtest.support.NativeTestSupport.getOrCreateTestRunProvider
import org.jetbrains.kotlin.konan.blackboxtest.support.group.DisabledTests
import org.jetbrains.kotlin.konan.blackboxtest.support.group.DisabledTestsIfProperty
import org.jetbrains.kotlin.konan.blackboxtest.support.group.K2Pipeline
import org.jetbrains.kotlin.konan.blackboxtest.support.group.FirPipeline
import org.jetbrains.kotlin.konan.blackboxtest.support.group.TestCaseGroupProvider
import org.jetbrains.kotlin.konan.blackboxtest.support.runner.SimpleTestRunProvider
import org.jetbrains.kotlin.konan.blackboxtest.support.runner.TestRunProvider
@@ -441,7 +441,7 @@ private object NativeTestSupport {
}
private fun computePipelineType(testClass: Class<*>): PipelineType {
return if (testClass.annotations.any { it is K2Pipeline })
return if (testClass.annotations.any { it is FirPipeline })
PipelineType.K2
else PipelineType.K1
}
@@ -5,4 +5,4 @@
package org.jetbrains.kotlin.konan.blackboxtest.support.group
@Target(AnnotationTarget.CLASS)
internal annotation class K2Pipeline
internal annotation class FirPipeline