From 01664da0a36a5580688c4caf18a82c4fd1f26520 Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Fri, 13 May 2022 14:19:28 +0300 Subject: [PATCH] [AllOpen] Migrate AllOpen tests to new test infrastructure --- .../kotlin/generators/tests/GenerateTests.kt | 19 +++--- plugins/allopen/allopen-cli/build.gradle.kts | 14 +++-- .../AbstractBytecodeListingTestForAllOpen.kt | 59 ++++++++++++++----- .../allopen/AllOpenEnvironmentConfigurator.kt | 25 ++++++++ .../bytecodeListing/allOpenOnNotClasses.txt | 2 +- .../allOpenOnNotClasses_ir.txt | 2 +- .../testData/bytecodeListing/alreadyOpen.txt | 2 +- .../bytecodeListing/annotationMembers.txt | 6 +- .../bytecodeListing/anonymousObject.txt | 2 +- .../bytecodeListing/anonymousObject_ir.txt | 2 +- .../bytecodeListing/explicitFinal.txt | 2 +- .../bytecodeListing/metaAnnotation.txt | 10 ++-- .../testData/bytecodeListing/nestedInner.txt | 2 +- .../bytecodeListing/privateMembers.txt | 4 +- .../bytecodeListing/privateMembers_ir.txt | 4 +- .../testData/bytecodeListing/sealed.txt | 2 +- .../bytecodeListing/severalAllOpen.txt | 4 +- .../testData/bytecodeListing/simple.txt | 2 +- .../bytecodeListing/springAnnotations.txt | 10 ++-- .../bytecodeListing/superClassAnnotation.txt | 2 +- ...ytecodeListingTestForAllOpenGenerated.java | 30 ++++++---- ...ytecodeListingTestForAllOpenGenerated.java | 30 ++++++---- 22 files changed, 157 insertions(+), 78 deletions(-) create mode 100644 plugins/allopen/allopen-cli/test/org/jetbrains/kotlin/allopen/AllOpenEnvironmentConfigurator.kt rename plugins/allopen/allopen-cli/{test => tests-gen}/org/jetbrains/kotlin/allopen/BytecodeListingTestForAllOpenGenerated.java (87%) rename plugins/allopen/allopen-cli/{test => tests-gen}/org/jetbrains/kotlin/allopen/IrBytecodeListingTestForAllOpenGenerated.java (87%) diff --git a/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt b/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt index 25ff363549e..d20e50f9f78 100644 --- a/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt +++ b/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt @@ -221,15 +221,6 @@ fun main(args: Array) { } } - testGroup("plugins/allopen/allopen-cli/test", "plugins/allopen/allopen-cli/testData") { - testClass { - model("bytecodeListing", extension = "kt") - } - testClass { - model("bytecodeListing", extension = "kt") - } - } - testGroup("plugins/noarg/noarg-cli/test", "plugins/noarg/noarg-cli/testData") { testClass { model("diagnostics", extension = "kt") } @@ -409,5 +400,15 @@ fun main(args: Array) { model("box/") } } + + testGroup("plugins/allopen/allopen-cli/tests-gen", "plugins/allopen/allopen-cli/testData") { + testClass { + model("bytecodeListing", excludedPattern = excludedFirTestdataPattern) + } + testClass { + model("bytecodeListing", excludedPattern = excludedFirTestdataPattern) + } + } + } } diff --git a/plugins/allopen/allopen-cli/build.gradle.kts b/plugins/allopen/allopen-cli/build.gradle.kts index 8654d11a5a3..54c3b9a5e55 100644 --- a/plugins/allopen/allopen-cli/build.gradle.kts +++ b/plugins/allopen/allopen-cli/build.gradle.kts @@ -1,4 +1,3 @@ - description = "Kotlin AllOpen Compiler Plugin" plugins { @@ -15,15 +14,21 @@ dependencies { testApi(project(":compiler:backend")) testApi(project(":compiler:cli")) - testApi(projectTests(":compiler:tests-common")) - testApi(commonDependency("junit:junit")) testApi(intellijCore()) + + testApiJUnit5() + testApi(projectTests(":compiler:tests-common-new")) + testApi(projectTests(":compiler:test-infrastructure")) + testApi(projectTests(":compiler:test-infrastructure-utils")) } sourceSets { "main" { projectDefault() } - "test" { projectDefault() } + "test" { + projectDefault() + generatedTestDir() + } } runtimeJar() @@ -36,4 +41,5 @@ testsJar() projectTest(parallel = true) { workingDir = rootDir + useJUnitPlatform() } diff --git a/plugins/allopen/allopen-cli/test/org/jetbrains/kotlin/allopen/AbstractBytecodeListingTestForAllOpen.kt b/plugins/allopen/allopen-cli/test/org/jetbrains/kotlin/allopen/AbstractBytecodeListingTestForAllOpen.kt index 1d393f4f6c9..49239bf1846 100644 --- a/plugins/allopen/allopen-cli/test/org/jetbrains/kotlin/allopen/AbstractBytecodeListingTestForAllOpen.kt +++ b/plugins/allopen/allopen-cli/test/org/jetbrains/kotlin/allopen/AbstractBytecodeListingTestForAllOpen.kt @@ -16,25 +16,52 @@ package org.jetbrains.kotlin.allopen -import org.jetbrains.kotlin.ObsoleteTestInfrastructure -import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment -import org.jetbrains.kotlin.codegen.AbstractBytecodeListingTest -import org.jetbrains.kotlin.extensions.DeclarationAttributeAltererExtension +import org.jetbrains.kotlin.test.Constructor import org.jetbrains.kotlin.test.TargetBackend +import org.jetbrains.kotlin.test.backend.classic.ClassicBackendInput +import org.jetbrains.kotlin.test.backend.classic.ClassicJvmBackendFacade +import org.jetbrains.kotlin.test.backend.ir.IrBackendInput +import org.jetbrains.kotlin.test.backend.ir.JvmIrBackendFacade +import org.jetbrains.kotlin.test.builders.TestConfigurationBuilder +import org.jetbrains.kotlin.test.frontend.classic.ClassicFrontend2ClassicBackendConverter +import org.jetbrains.kotlin.test.frontend.classic.ClassicFrontend2IrConverter +import org.jetbrains.kotlin.test.frontend.classic.ClassicFrontendFacade +import org.jetbrains.kotlin.test.frontend.classic.ClassicFrontendOutputArtifact +import org.jetbrains.kotlin.test.model.* +import org.jetbrains.kotlin.test.runners.codegen.AbstractBytecodeListingTestBase -@OptIn(ObsoleteTestInfrastructure::class) -abstract class AbstractBytecodeListingTestForAllOpen : AbstractBytecodeListingTest() { - override fun setupEnvironment(environment: KotlinCoreEnvironment) { - val annotations = AbstractAllOpenDeclarationAttributeAltererExtension.ANNOTATIONS_FOR_TESTS + - AllOpenCommandLineProcessor.SUPPORTED_PRESETS.flatMap { it.value } - - DeclarationAttributeAltererExtension.registerExtension( - environment.project, - CliAllOpenDeclarationAttributeAltererExtension(annotations) - ) +abstract class AbstractBytecodeListingTestForAllOpenBase, I : ResultingArtifact.BackendInput>( + targetBackend: TargetBackend, + targetFrontend: FrontendKind +) : AbstractBytecodeListingTestBase(targetBackend, targetFrontend){ + override fun configure(builder: TestConfigurationBuilder) { + super.configure(builder) + builder.apply { + useConfigurators(::AllOpenEnvironmentConfigurator) + } } } -abstract class AbstractIrBytecodeListingTestForAllOpen : AbstractBytecodeListingTestForAllOpen() { - override val backend = TargetBackend.JVM_IR +open class AbstractBytecodeListingTestForAllOpen : + AbstractBytecodeListingTestForAllOpenBase( + TargetBackend.JVM, FrontendKinds.ClassicFrontend + ) { + override val frontendFacade: Constructor> + get() = ::ClassicFrontendFacade + override val frontendToBackendConverter: Constructor> + get() = ::ClassicFrontend2ClassicBackendConverter + override val backendFacade: Constructor> + get() = ::ClassicJvmBackendFacade +} + +open class AbstractIrBytecodeListingTestForAllOpen : + AbstractBytecodeListingTestForAllOpenBase( + TargetBackend.JVM_IR, FrontendKinds.ClassicFrontend + ) { + override val frontendFacade: Constructor> + get() = ::ClassicFrontendFacade + override val frontendToBackendConverter: Constructor> + get() = ::ClassicFrontend2IrConverter + override val backendFacade: Constructor> + get() = ::JvmIrBackendFacade } diff --git a/plugins/allopen/allopen-cli/test/org/jetbrains/kotlin/allopen/AllOpenEnvironmentConfigurator.kt b/plugins/allopen/allopen-cli/test/org/jetbrains/kotlin/allopen/AllOpenEnvironmentConfigurator.kt new file mode 100644 index 00000000000..7690c6eed5b --- /dev/null +++ b/plugins/allopen/allopen-cli/test/org/jetbrains/kotlin/allopen/AllOpenEnvironmentConfigurator.kt @@ -0,0 +1,25 @@ +/* + * Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.allopen + +import com.intellij.openapi.project.Project +import org.jetbrains.kotlin.config.CompilerConfiguration +import org.jetbrains.kotlin.extensions.DeclarationAttributeAltererExtension +import org.jetbrains.kotlin.test.model.TestModule +import org.jetbrains.kotlin.test.services.EnvironmentConfigurator +import org.jetbrains.kotlin.test.services.TestServices + +class AllOpenEnvironmentConfigurator(testServices: TestServices) : EnvironmentConfigurator(testServices) { + override fun registerCompilerExtensions(project: Project, module: TestModule, configuration: CompilerConfiguration) { + val annotations = AbstractAllOpenDeclarationAttributeAltererExtension.ANNOTATIONS_FOR_TESTS + + AllOpenCommandLineProcessor.SUPPORTED_PRESETS.flatMap { it.value } + + DeclarationAttributeAltererExtension.registerExtension( + project, + CliAllOpenDeclarationAttributeAltererExtension(annotations) + ) + } +} diff --git a/plugins/allopen/allopen-cli/testData/bytecodeListing/allOpenOnNotClasses.txt b/plugins/allopen/allopen-cli/testData/bytecodeListing/allOpenOnNotClasses.txt index 51784133393..0209ce55af4 100644 --- a/plugins/allopen/allopen-cli/testData/bytecodeListing/allOpenOnNotClasses.txt +++ b/plugins/allopen/allopen-cli/testData/bytecodeListing/allOpenOnNotClasses.txt @@ -1,5 +1,5 @@ @AllOpen -@java.lang.annotation.Retention +@java.lang.annotation.Retention(value=RUNTIME) @kotlin.Metadata public annotation class AllOpen { // source: 'allOpenOnNotClasses.kt' diff --git a/plugins/allopen/allopen-cli/testData/bytecodeListing/allOpenOnNotClasses_ir.txt b/plugins/allopen/allopen-cli/testData/bytecodeListing/allOpenOnNotClasses_ir.txt index 576fcfe7086..12c65dfbfa6 100644 --- a/plugins/allopen/allopen-cli/testData/bytecodeListing/allOpenOnNotClasses_ir.txt +++ b/plugins/allopen/allopen-cli/testData/bytecodeListing/allOpenOnNotClasses_ir.txt @@ -1,5 +1,5 @@ @AllOpen -@java.lang.annotation.Retention +@java.lang.annotation.Retention(value=RUNTIME) @kotlin.Metadata public annotation class AllOpen { // source: 'allOpenOnNotClasses.kt' diff --git a/plugins/allopen/allopen-cli/testData/bytecodeListing/alreadyOpen.txt b/plugins/allopen/allopen-cli/testData/bytecodeListing/alreadyOpen.txt index b61c7134e44..ba35f69da31 100644 --- a/plugins/allopen/allopen-cli/testData/bytecodeListing/alreadyOpen.txt +++ b/plugins/allopen/allopen-cli/testData/bytecodeListing/alreadyOpen.txt @@ -1,4 +1,4 @@ -@java.lang.annotation.Retention +@java.lang.annotation.Retention(value=RUNTIME) @kotlin.Metadata public annotation class AllOpen { // source: 'alreadyOpen.kt' diff --git a/plugins/allopen/allopen-cli/testData/bytecodeListing/annotationMembers.txt b/plugins/allopen/allopen-cli/testData/bytecodeListing/annotationMembers.txt index 672efa422f2..581d87eabfe 100644 --- a/plugins/allopen/allopen-cli/testData/bytecodeListing/annotationMembers.txt +++ b/plugins/allopen/allopen-cli/testData/bytecodeListing/annotationMembers.txt @@ -1,4 +1,4 @@ -@java.lang.annotation.Retention +@java.lang.annotation.Retention(value=RUNTIME) @kotlin.Metadata public annotation class AllOpen { // source: 'annotationMembers.kt' @@ -18,7 +18,7 @@ public final class MyComponent$Companion { } @AllOpen -@java.lang.annotation.Retention +@java.lang.annotation.Retention(value=RUNTIME) @kotlin.Metadata public annotation class MyComponent { // source: 'annotationMembers.kt' @@ -44,7 +44,7 @@ public final class Plain$Companion { public final inner class Plain$Companion } -@java.lang.annotation.Retention +@java.lang.annotation.Retention(value=RUNTIME) @kotlin.Metadata public annotation class Plain { // source: 'annotationMembers.kt' diff --git a/plugins/allopen/allopen-cli/testData/bytecodeListing/anonymousObject.txt b/plugins/allopen/allopen-cli/testData/bytecodeListing/anonymousObject.txt index f0f162505f8..01befb6fa36 100644 --- a/plugins/allopen/allopen-cli/testData/bytecodeListing/anonymousObject.txt +++ b/plugins/allopen/allopen-cli/testData/bytecodeListing/anonymousObject.txt @@ -1,4 +1,4 @@ -@java.lang.annotation.Retention +@java.lang.annotation.Retention(value=RUNTIME) @kotlin.Metadata public annotation class AllOpen { // source: 'anonymousObject.kt' diff --git a/plugins/allopen/allopen-cli/testData/bytecodeListing/anonymousObject_ir.txt b/plugins/allopen/allopen-cli/testData/bytecodeListing/anonymousObject_ir.txt index b89d4464db7..bed315082b6 100644 --- a/plugins/allopen/allopen-cli/testData/bytecodeListing/anonymousObject_ir.txt +++ b/plugins/allopen/allopen-cli/testData/bytecodeListing/anonymousObject_ir.txt @@ -1,4 +1,4 @@ -@java.lang.annotation.Retention +@java.lang.annotation.Retention(value=RUNTIME) @kotlin.Metadata public annotation class AllOpen { // source: 'anonymousObject.kt' diff --git a/plugins/allopen/allopen-cli/testData/bytecodeListing/explicitFinal.txt b/plugins/allopen/allopen-cli/testData/bytecodeListing/explicitFinal.txt index bae893947c1..409375160c6 100644 --- a/plugins/allopen/allopen-cli/testData/bytecodeListing/explicitFinal.txt +++ b/plugins/allopen/allopen-cli/testData/bytecodeListing/explicitFinal.txt @@ -1,4 +1,4 @@ -@java.lang.annotation.Retention +@java.lang.annotation.Retention(value=RUNTIME) @kotlin.Metadata public annotation class AllOpen { // source: 'explicitFinal.kt' diff --git a/plugins/allopen/allopen-cli/testData/bytecodeListing/metaAnnotation.txt b/plugins/allopen/allopen-cli/testData/bytecodeListing/metaAnnotation.txt index 701131eef3b..59fd54829e5 100644 --- a/plugins/allopen/allopen-cli/testData/bytecodeListing/metaAnnotation.txt +++ b/plugins/allopen/allopen-cli/testData/bytecodeListing/metaAnnotation.txt @@ -1,11 +1,11 @@ -@java.lang.annotation.Retention +@java.lang.annotation.Retention(value=RUNTIME) @kotlin.Metadata public annotation class AllOpen { // source: 'metaAnnotation.kt' } @OtherComponent -@java.lang.annotation.Retention +@java.lang.annotation.Retention(value=RUNTIME) @kotlin.Metadata public annotation class AnotherComponent { // source: 'metaAnnotation.kt' @@ -19,14 +19,14 @@ public final class ClassWithDocumented { } @java.lang.annotation.Documented -@java.lang.annotation.Retention +@java.lang.annotation.Retention(value=RUNTIME) @kotlin.Metadata public annotation class Documented { // source: 'metaAnnotation.kt' } @AllOpen -@java.lang.annotation.Retention +@java.lang.annotation.Retention(value=RUNTIME) @kotlin.Metadata public annotation class MyComponent { // source: 'metaAnnotation.kt' @@ -61,7 +61,7 @@ public class MyComponentImpl_ShouldBeOpen { } @MyComponent -@java.lang.annotation.Retention +@java.lang.annotation.Retention(value=RUNTIME) @kotlin.Metadata public annotation class OtherComponent { // source: 'metaAnnotation.kt' diff --git a/plugins/allopen/allopen-cli/testData/bytecodeListing/nestedInner.txt b/plugins/allopen/allopen-cli/testData/bytecodeListing/nestedInner.txt index ff5cd53d6aa..c3f100a0a0a 100644 --- a/plugins/allopen/allopen-cli/testData/bytecodeListing/nestedInner.txt +++ b/plugins/allopen/allopen-cli/testData/bytecodeListing/nestedInner.txt @@ -1,4 +1,4 @@ -@java.lang.annotation.Retention +@java.lang.annotation.Retention(value=RUNTIME) @kotlin.Metadata public annotation class AllOpen { // source: 'nestedInner.kt' diff --git a/plugins/allopen/allopen-cli/testData/bytecodeListing/privateMembers.txt b/plugins/allopen/allopen-cli/testData/bytecodeListing/privateMembers.txt index cc61263f2d4..bce4133f073 100644 --- a/plugins/allopen/allopen-cli/testData/bytecodeListing/privateMembers.txt +++ b/plugins/allopen/allopen-cli/testData/bytecodeListing/privateMembers.txt @@ -13,10 +13,10 @@ class Test { private final @org.jetbrains.annotations.NotNull field protectedProp: java.lang.String private final @org.jetbrains.annotations.NotNull field publicProp: java.lang.String public method (): void - public @org.jetbrains.annotations.NotNull method getInternalProp$test_module(): java.lang.String + public @org.jetbrains.annotations.NotNull method getInternalProp$main(): java.lang.String protected @org.jetbrains.annotations.NotNull method getProtectedProp(): java.lang.String public @org.jetbrains.annotations.NotNull method getPublicProp(): java.lang.String - public method internalMethod$test_module(): void + public method internalMethod$main(): void private method privateMethod(): void private method privateTailrecMethod(): void protected method protectedMethod(): void diff --git a/plugins/allopen/allopen-cli/testData/bytecodeListing/privateMembers_ir.txt b/plugins/allopen/allopen-cli/testData/bytecodeListing/privateMembers_ir.txt index 36ba4085ff0..afa8ded2827 100644 --- a/plugins/allopen/allopen-cli/testData/bytecodeListing/privateMembers_ir.txt +++ b/plugins/allopen/allopen-cli/testData/bytecodeListing/privateMembers_ir.txt @@ -13,10 +13,10 @@ class Test { private final @org.jetbrains.annotations.NotNull field protectedProp: java.lang.String private final @org.jetbrains.annotations.NotNull field publicProp: java.lang.String public method (): void - public @org.jetbrains.annotations.NotNull method getInternalProp$test_module(): java.lang.String + public @org.jetbrains.annotations.NotNull method getInternalProp$main(): java.lang.String protected @org.jetbrains.annotations.NotNull method getProtectedProp(): java.lang.String public @org.jetbrains.annotations.NotNull method getPublicProp(): java.lang.String - public method internalMethod$test_module(): void + public method internalMethod$main(): void private method privateMethod(): void private method privateTailrecMethod(): void protected method protectedMethod(): void diff --git a/plugins/allopen/allopen-cli/testData/bytecodeListing/sealed.txt b/plugins/allopen/allopen-cli/testData/bytecodeListing/sealed.txt index a9a8ef6f51b..8ba489290cb 100644 --- a/plugins/allopen/allopen-cli/testData/bytecodeListing/sealed.txt +++ b/plugins/allopen/allopen-cli/testData/bytecodeListing/sealed.txt @@ -1,4 +1,4 @@ -@java.lang.annotation.Retention +@java.lang.annotation.Retention(value=RUNTIME) @kotlin.Metadata public annotation class AllOpen { // source: 'sealed.kt' diff --git a/plugins/allopen/allopen-cli/testData/bytecodeListing/severalAllOpen.txt b/plugins/allopen/allopen-cli/testData/bytecodeListing/severalAllOpen.txt index 4f98205faf5..55a60ecc684 100644 --- a/plugins/allopen/allopen-cli/testData/bytecodeListing/severalAllOpen.txt +++ b/plugins/allopen/allopen-cli/testData/bytecodeListing/severalAllOpen.txt @@ -1,10 +1,10 @@ -@java.lang.annotation.Retention +@java.lang.annotation.Retention(value=RUNTIME) @kotlin.Metadata public annotation class AllOpen { // source: 'severalAllOpen.kt' } -@java.lang.annotation.Retention +@java.lang.annotation.Retention(value=RUNTIME) @kotlin.Metadata public annotation class AllOpen2 { // source: 'severalAllOpen.kt' diff --git a/plugins/allopen/allopen-cli/testData/bytecodeListing/simple.txt b/plugins/allopen/allopen-cli/testData/bytecodeListing/simple.txt index 54ab024e3d6..c4879375207 100644 --- a/plugins/allopen/allopen-cli/testData/bytecodeListing/simple.txt +++ b/plugins/allopen/allopen-cli/testData/bytecodeListing/simple.txt @@ -1,4 +1,4 @@ -@java.lang.annotation.Retention +@java.lang.annotation.Retention(value=RUNTIME) @kotlin.Metadata public annotation class AllOpen { // source: 'simple.kt' diff --git a/plugins/allopen/allopen-cli/testData/bytecodeListing/springAnnotations.txt b/plugins/allopen/allopen-cli/testData/bytecodeListing/springAnnotations.txt index e0d04c025d7..c17b3cbdf5b 100644 --- a/plugins/allopen/allopen-cli/testData/bytecodeListing/springAnnotations.txt +++ b/plugins/allopen/allopen-cli/testData/bytecodeListing/springAnnotations.txt @@ -1,28 +1,28 @@ -@java.lang.annotation.Retention +@java.lang.annotation.Retention(value=RUNTIME) @kotlin.Metadata public annotation class org/springframework/boot/test/context/SpringBootTest { // source: 'springBootTest.kt' } -@java.lang.annotation.Retention +@java.lang.annotation.Retention(value=RUNTIME) @kotlin.Metadata public annotation class org/springframework/cache/annotation/Cacheable { // source: 'cacheable.kt' } -@java.lang.annotation.Retention +@java.lang.annotation.Retention(value=RUNTIME) @kotlin.Metadata public annotation class org/springframework/scheduling/annotation/Async { // source: 'async.kt' } -@java.lang.annotation.Retention +@java.lang.annotation.Retention(value=RUNTIME) @kotlin.Metadata public annotation class org/springframework/stereotype/Component { // source: 'component.kt' } -@java.lang.annotation.Retention +@java.lang.annotation.Retention(value=RUNTIME) @kotlin.Metadata public annotation class org/springframework/transaction/annotation/Transactional { // source: 'transactional.kt' diff --git a/plugins/allopen/allopen-cli/testData/bytecodeListing/superClassAnnotation.txt b/plugins/allopen/allopen-cli/testData/bytecodeListing/superClassAnnotation.txt index e22a7a2194f..ded1ba7997d 100644 --- a/plugins/allopen/allopen-cli/testData/bytecodeListing/superClassAnnotation.txt +++ b/plugins/allopen/allopen-cli/testData/bytecodeListing/superClassAnnotation.txt @@ -1,4 +1,4 @@ -@java.lang.annotation.Retention +@java.lang.annotation.Retention(value=RUNTIME) @kotlin.Metadata public annotation class AllOpen { // source: 'superClassAnnotation.kt' diff --git a/plugins/allopen/allopen-cli/test/org/jetbrains/kotlin/allopen/BytecodeListingTestForAllOpenGenerated.java b/plugins/allopen/allopen-cli/tests-gen/org/jetbrains/kotlin/allopen/BytecodeListingTestForAllOpenGenerated.java similarity index 87% rename from plugins/allopen/allopen-cli/test/org/jetbrains/kotlin/allopen/BytecodeListingTestForAllOpenGenerated.java rename to plugins/allopen/allopen-cli/tests-gen/org/jetbrains/kotlin/allopen/BytecodeListingTestForAllOpenGenerated.java index 26aa87888e6..d51c66ef42d 100644 --- a/plugins/allopen/allopen-cli/test/org/jetbrains/kotlin/allopen/BytecodeListingTestForAllOpenGenerated.java +++ b/plugins/allopen/allopen-cli/tests-gen/org/jetbrains/kotlin/allopen/BytecodeListingTestForAllOpenGenerated.java @@ -6,94 +6,104 @@ package org.jetbrains.kotlin.allopen; import com.intellij.testFramework.TestDataPath; -import org.jetbrains.kotlin.test.JUnit3RunnerWithInners; -import org.jetbrains.kotlin.test.KotlinTestUtils; import org.jetbrains.kotlin.test.util.KtTestUtil; +import org.jetbrains.kotlin.test.TargetBackend; import org.jetbrains.kotlin.test.TestMetadata; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Nested; +import org.junit.jupiter.api.Test; import java.io.File; import java.util.regex.Pattern; -/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */ +/** This class is generated by {@link GenerateNewCompilerTests.kt}. DO NOT MODIFY MANUALLY */ @SuppressWarnings("all") @TestMetadata("plugins/allopen/allopen-cli/testData/bytecodeListing") @TestDataPath("$PROJECT_ROOT") -@RunWith(JUnit3RunnerWithInners.class) public class BytecodeListingTestForAllOpenGenerated extends AbstractBytecodeListingTestForAllOpen { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + @Test public void testAllFilesPresentInBytecodeListing() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("plugins/allopen/allopen-cli/testData/bytecodeListing"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("plugins/allopen/allopen-cli/testData/bytecodeListing"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), TargetBackend.JVM, true); } + @Test @TestMetadata("allOpenOnNotClasses.kt") public void testAllOpenOnNotClasses() throws Exception { runTest("plugins/allopen/allopen-cli/testData/bytecodeListing/allOpenOnNotClasses.kt"); } + @Test @TestMetadata("alreadyOpen.kt") public void testAlreadyOpen() throws Exception { runTest("plugins/allopen/allopen-cli/testData/bytecodeListing/alreadyOpen.kt"); } + @Test @TestMetadata("annotationMembers.kt") public void testAnnotationMembers() throws Exception { runTest("plugins/allopen/allopen-cli/testData/bytecodeListing/annotationMembers.kt"); } + @Test @TestMetadata("anonymousObject.kt") public void testAnonymousObject() throws Exception { runTest("plugins/allopen/allopen-cli/testData/bytecodeListing/anonymousObject.kt"); } + @Test @TestMetadata("explicitFinal.kt") public void testExplicitFinal() throws Exception { runTest("plugins/allopen/allopen-cli/testData/bytecodeListing/explicitFinal.kt"); } + @Test @TestMetadata("metaAnnotation.kt") public void testMetaAnnotation() throws Exception { runTest("plugins/allopen/allopen-cli/testData/bytecodeListing/metaAnnotation.kt"); } + @Test @TestMetadata("nestedInner.kt") public void testNestedInner() throws Exception { runTest("plugins/allopen/allopen-cli/testData/bytecodeListing/nestedInner.kt"); } + @Test @TestMetadata("noAllOpen.kt") public void testNoAllOpen() throws Exception { runTest("plugins/allopen/allopen-cli/testData/bytecodeListing/noAllOpen.kt"); } + @Test @TestMetadata("privateMembers.kt") public void testPrivateMembers() throws Exception { runTest("plugins/allopen/allopen-cli/testData/bytecodeListing/privateMembers.kt"); } + @Test @TestMetadata("sealed.kt") public void testSealed() throws Exception { runTest("plugins/allopen/allopen-cli/testData/bytecodeListing/sealed.kt"); } + @Test @TestMetadata("severalAllOpen.kt") public void testSeveralAllOpen() throws Exception { runTest("plugins/allopen/allopen-cli/testData/bytecodeListing/severalAllOpen.kt"); } + @Test @TestMetadata("simple.kt") public void testSimple() throws Exception { runTest("plugins/allopen/allopen-cli/testData/bytecodeListing/simple.kt"); } + @Test @TestMetadata("springAnnotations.kt") public void testSpringAnnotations() throws Exception { runTest("plugins/allopen/allopen-cli/testData/bytecodeListing/springAnnotations.kt"); } + @Test @TestMetadata("superClassAnnotation.kt") public void testSuperClassAnnotation() throws Exception { runTest("plugins/allopen/allopen-cli/testData/bytecodeListing/superClassAnnotation.kt"); diff --git a/plugins/allopen/allopen-cli/test/org/jetbrains/kotlin/allopen/IrBytecodeListingTestForAllOpenGenerated.java b/plugins/allopen/allopen-cli/tests-gen/org/jetbrains/kotlin/allopen/IrBytecodeListingTestForAllOpenGenerated.java similarity index 87% rename from plugins/allopen/allopen-cli/test/org/jetbrains/kotlin/allopen/IrBytecodeListingTestForAllOpenGenerated.java rename to plugins/allopen/allopen-cli/tests-gen/org/jetbrains/kotlin/allopen/IrBytecodeListingTestForAllOpenGenerated.java index cdac8532697..ae09100ff12 100644 --- a/plugins/allopen/allopen-cli/test/org/jetbrains/kotlin/allopen/IrBytecodeListingTestForAllOpenGenerated.java +++ b/plugins/allopen/allopen-cli/tests-gen/org/jetbrains/kotlin/allopen/IrBytecodeListingTestForAllOpenGenerated.java @@ -6,94 +6,104 @@ package org.jetbrains.kotlin.allopen; import com.intellij.testFramework.TestDataPath; -import org.jetbrains.kotlin.test.JUnit3RunnerWithInners; -import org.jetbrains.kotlin.test.KotlinTestUtils; import org.jetbrains.kotlin.test.util.KtTestUtil; +import org.jetbrains.kotlin.test.TargetBackend; import org.jetbrains.kotlin.test.TestMetadata; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Nested; +import org.junit.jupiter.api.Test; import java.io.File; import java.util.regex.Pattern; -/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */ +/** This class is generated by {@link GenerateNewCompilerTests.kt}. DO NOT MODIFY MANUALLY */ @SuppressWarnings("all") @TestMetadata("plugins/allopen/allopen-cli/testData/bytecodeListing") @TestDataPath("$PROJECT_ROOT") -@RunWith(JUnit3RunnerWithInners.class) public class IrBytecodeListingTestForAllOpenGenerated extends AbstractIrBytecodeListingTestForAllOpen { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + @Test public void testAllFilesPresentInBytecodeListing() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("plugins/allopen/allopen-cli/testData/bytecodeListing"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("plugins/allopen/allopen-cli/testData/bytecodeListing"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), TargetBackend.JVM_IR, true); } + @Test @TestMetadata("allOpenOnNotClasses.kt") public void testAllOpenOnNotClasses() throws Exception { runTest("plugins/allopen/allopen-cli/testData/bytecodeListing/allOpenOnNotClasses.kt"); } + @Test @TestMetadata("alreadyOpen.kt") public void testAlreadyOpen() throws Exception { runTest("plugins/allopen/allopen-cli/testData/bytecodeListing/alreadyOpen.kt"); } + @Test @TestMetadata("annotationMembers.kt") public void testAnnotationMembers() throws Exception { runTest("plugins/allopen/allopen-cli/testData/bytecodeListing/annotationMembers.kt"); } + @Test @TestMetadata("anonymousObject.kt") public void testAnonymousObject() throws Exception { runTest("plugins/allopen/allopen-cli/testData/bytecodeListing/anonymousObject.kt"); } + @Test @TestMetadata("explicitFinal.kt") public void testExplicitFinal() throws Exception { runTest("plugins/allopen/allopen-cli/testData/bytecodeListing/explicitFinal.kt"); } + @Test @TestMetadata("metaAnnotation.kt") public void testMetaAnnotation() throws Exception { runTest("plugins/allopen/allopen-cli/testData/bytecodeListing/metaAnnotation.kt"); } + @Test @TestMetadata("nestedInner.kt") public void testNestedInner() throws Exception { runTest("plugins/allopen/allopen-cli/testData/bytecodeListing/nestedInner.kt"); } + @Test @TestMetadata("noAllOpen.kt") public void testNoAllOpen() throws Exception { runTest("plugins/allopen/allopen-cli/testData/bytecodeListing/noAllOpen.kt"); } + @Test @TestMetadata("privateMembers.kt") public void testPrivateMembers() throws Exception { runTest("plugins/allopen/allopen-cli/testData/bytecodeListing/privateMembers.kt"); } + @Test @TestMetadata("sealed.kt") public void testSealed() throws Exception { runTest("plugins/allopen/allopen-cli/testData/bytecodeListing/sealed.kt"); } + @Test @TestMetadata("severalAllOpen.kt") public void testSeveralAllOpen() throws Exception { runTest("plugins/allopen/allopen-cli/testData/bytecodeListing/severalAllOpen.kt"); } + @Test @TestMetadata("simple.kt") public void testSimple() throws Exception { runTest("plugins/allopen/allopen-cli/testData/bytecodeListing/simple.kt"); } + @Test @TestMetadata("springAnnotations.kt") public void testSpringAnnotations() throws Exception { runTest("plugins/allopen/allopen-cli/testData/bytecodeListing/springAnnotations.kt"); } + @Test @TestMetadata("superClassAnnotation.kt") public void testSuperClassAnnotation() throws Exception { runTest("plugins/allopen/allopen-cli/testData/bytecodeListing/superClassAnnotation.kt");