From 60df531c02017ce4a29c2c4ba38c1a214b13792a Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Tue, 17 May 2022 17:30:35 +0300 Subject: [PATCH] [NoArg] Migrate NoArg tests to new test infrastructure --- .../kotlin/generators/tests/GenerateTests.kt | 31 ++--- plugins/noarg/build.gradle.kts | 19 +++- .../org/jetbrains/kotlin/noarg/NoArgPlugin.kt | 17 +-- .../org/jetbrains/kotlin/noarg/NoArgTests.kt | 107 ++++++++++++------ .../bytecodeListing/annoOnNotClass.txt | 2 +- .../bytecodeListing/annoOnNotClass_ir.txt | 2 +- .../bytecodeListing/constructorVisibility.txt | 2 +- .../bytecodeListing/defaultParameters.txt | 4 +- .../testData/bytecodeListing/inherited.txt | 4 +- .../testData/bytecodeListing/nestedClass.txt | 2 +- .../testData/bytecodeListing/noNoArg.txt | 2 +- .../testData/bytecodeListing/severalNoArg.txt | 4 +- .../noarg/testData/bytecodeListing/simple.txt | 2 +- .../testData/bytecodeListing/superTypes.txt | 2 +- .../noarg/testData/diagnostics/innerClass.kt | 1 + .../diagnostics/noNoargCtorInSuperclass.kt | 1 + .../BlackBoxCodegenTestForNoArgGenerated.java | 47 ++++---- .../BytecodeListingTestForNoArgGenerated.java | 44 +++---- .../DiagnosticsTestForNoArgGenerated.java | 23 ++-- ...rBlackBoxCodegenTestForNoArgGenerated.java | 47 ++++---- ...rBytecodeListingTestForNoArgGenerated.java | 44 +++---- 21 files changed, 233 insertions(+), 174 deletions(-) rename plugins/noarg/{test => tests-gen}/org/jetbrains/kotlin/noarg/BlackBoxCodegenTestForNoArgGenerated.java (56%) rename plugins/noarg/{test => tests-gen}/org/jetbrains/kotlin/noarg/BytecodeListingTestForNoArgGenerated.java (53%) rename plugins/noarg/{test => tests-gen}/org/jetbrains/kotlin/noarg/DiagnosticsTestForNoArgGenerated.java (54%) rename plugins/noarg/{test => tests-gen}/org/jetbrains/kotlin/noarg/IrBlackBoxCodegenTestForNoArgGenerated.java (56%) rename plugins/noarg/{test => tests-gen}/org/jetbrains/kotlin/noarg/IrBytecodeListingTestForNoArgGenerated.java (53%) diff --git a/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt b/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt index cbc0dcc2692..ec9e40e76af 100644 --- a/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt +++ b/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt @@ -222,20 +222,6 @@ fun main(args: Array) { } } - testGroup("plugins/noarg/noarg-cli/test", "plugins/noarg/noarg-cli/testData") { - testClass { model("diagnostics", extension = "kt") } - - testClass { - model("bytecodeListing", extension = "kt", targetBackend = TargetBackend.JVM) - } - testClass { - model("bytecodeListing", extension = "kt", targetBackend = TargetBackend.JVM_IR) - } - - testClass { model("box", targetBackend = TargetBackend.JVM) } - testClass { model("box", targetBackend = TargetBackend.JVM_IR) } - } - testGroup("plugins/sam-with-receiver/sam-with-receiver-cli/test", "plugins/sam-with-receiver/sam-with-receiver-cli/testData") { testClass { model("diagnostics") @@ -414,5 +400,22 @@ fun main(args: Array) { } } + testGroup("plugins/noarg/tests-gen", "plugins/noarg/testData") { + testClass { + model("diagnostics", excludedPattern = excludedFirTestdataPattern) + } + testClass { + model("bytecodeListing", excludedPattern = excludedFirTestdataPattern) + } + testClass { + model("bytecodeListing", excludedPattern = excludedFirTestdataPattern) + } + testClass { + model("box") + } + testClass { + model("box") + } + } } } diff --git a/plugins/noarg/build.gradle.kts b/plugins/noarg/build.gradle.kts index 0a5a66ed3ae..ce100a34ac1 100644 --- a/plugins/noarg/build.gradle.kts +++ b/plugins/noarg/build.gradle.kts @@ -12,14 +12,26 @@ dependencies { testApi(project(":compiler:backend")) testApi(project(":compiler:cli")) - testApi(projectTests(":compiler:tests-common")) - testApi(commonDependency("junit:junit")) + testApi(project(":kotlin-noarg-compiler-plugin.cli")) + + testApiJUnit5() + testApi(projectTests(":compiler:tests-common-new")) + testApi(projectTests(":compiler:test-infrastructure")) + testApi(projectTests(":compiler:test-infrastructure-utils")) + + testCompileOnly(project(":kotlin-reflect-api")) + testRuntimeOnly(project(":kotlin-reflect")) + testRuntimeOnly(project(":core:descriptors.runtime")) + testApi(intellijCore()) } sourceSets { "main" { none() } - "test" { projectDefault() } + "test" { + projectDefault() + generatedTestDir() + } } runtimeJar() @@ -29,4 +41,5 @@ testsJar() projectTest(parallel = true) { workingDir = rootDir + useJUnitPlatform() } diff --git a/plugins/noarg/noarg.cli/src/org/jetbrains/kotlin/noarg/NoArgPlugin.kt b/plugins/noarg/noarg.cli/src/org/jetbrains/kotlin/noarg/NoArgPlugin.kt index 158341fcea6..91d9d83873c 100644 --- a/plugins/noarg/noarg.cli/src/org/jetbrains/kotlin/noarg/NoArgPlugin.kt +++ b/plugins/noarg/noarg.cli/src/org/jetbrains/kotlin/noarg/NoArgPlugin.kt @@ -1,17 +1,6 @@ /* - * Copyright 2010-2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * 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.noarg @@ -96,7 +85,7 @@ class NoArgComponentRegistrar : ComponentRegistrar { } } - internal companion object { + companion object { fun registerNoArgComponents(project: Project, annotations: List, useIr: Boolean, invokeInitializers: Boolean) { StorageComponentContainerContributor.registerExtension(project, CliNoArgComponentContainerContributor(annotations, useIr)) ExpressionCodegenExtension.registerExtension(project, CliNoArgExpressionCodegenExtension(annotations, invokeInitializers)) diff --git a/plugins/noarg/test/org/jetbrains/kotlin/noarg/NoArgTests.kt b/plugins/noarg/test/org/jetbrains/kotlin/noarg/NoArgTests.kt index 1dd64bbb277..d8033adeb3a 100644 --- a/plugins/noarg/test/org/jetbrains/kotlin/noarg/NoArgTests.kt +++ b/plugins/noarg/test/org/jetbrains/kotlin/noarg/NoArgTests.kt @@ -5,47 +5,84 @@ package org.jetbrains.kotlin.noarg -import org.jetbrains.kotlin.ObsoleteTestInfrastructure -import org.jetbrains.kotlin.checkers.AbstractDiagnosticsTest -import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment -import org.jetbrains.kotlin.codegen.AbstractBlackBoxCodegenTest -import org.jetbrains.kotlin.codegen.AbstractBytecodeListingTest -import org.jetbrains.kotlin.test.TargetBackend +import com.intellij.openapi.project.Project +import org.jetbrains.kotlin.config.CompilerConfiguration +import org.jetbrains.kotlin.test.builders.TestConfigurationBuilder +import org.jetbrains.kotlin.test.directives.model.DirectivesContainer +import org.jetbrains.kotlin.test.directives.model.SimpleDirectivesContainer +import org.jetbrains.kotlin.test.model.TestModule +import org.jetbrains.kotlin.test.runners.AbstractDiagnosticTest +import org.jetbrains.kotlin.test.runners.codegen.AbstractBlackBoxCodegenTest +import org.jetbrains.kotlin.test.runners.codegen.AbstractBytecodeListingTest +import org.jetbrains.kotlin.test.runners.codegen.AbstractIrBlackBoxCodegenTest +import org.jetbrains.kotlin.test.runners.codegen.AbstractIrBytecodeListingTest +import org.jetbrains.kotlin.test.services.EnvironmentConfigurator +import org.jetbrains.kotlin.test.services.TestServices -internal val NOARG_ANNOTATIONS = listOf("NoArg", "NoArg2", "test.NoArg") +// ---------------------------- codegen ---------------------------- -@OptIn(ObsoleteTestInfrastructure::class) -abstract class AbstractBlackBoxCodegenTestForNoArg : AbstractBlackBoxCodegenTest() { - override fun loadMultiFiles(files: MutableList) { +open class AbstractBlackBoxCodegenTestForNoArg : AbstractBlackBoxCodegenTest() { + override fun configure(builder: TestConfigurationBuilder) { + super.configure(builder) + builder.enableNoArg() + } +} + +open class AbstractIrBlackBoxCodegenTestForNoArg : AbstractIrBlackBoxCodegenTest() { + override fun configure(builder: TestConfigurationBuilder) { + super.configure(builder) + builder.enableNoArg() + } +} + +// ---------------------------- bytecode ---------------------------- + +open class AbstractBytecodeListingTestForNoArg : AbstractBytecodeListingTest() { + override fun configure(builder: TestConfigurationBuilder) { + super.configure(builder) + builder.enableNoArg() + } +} + +open class AbstractIrBytecodeListingTestForNoArg : AbstractIrBytecodeListingTest() { + override fun configure(builder: TestConfigurationBuilder) { + super.configure(builder) + builder.enableNoArg() + } +} + +// ---------------------------- diagnostic ---------------------------- + +abstract class AbstractDiagnosticsTestForNoArg : AbstractDiagnosticTest() { + override fun configure(builder: TestConfigurationBuilder) { + super.configure(builder) + builder.enableNoArg() + } +} + +// ---------------------------- configurator ---------------------------- + +private fun TestConfigurationBuilder.enableNoArg() { + useConfigurators(::NoArgEnvironmentConfigurator) +} + +class NoArgEnvironmentConfigurator(testServices: TestServices) : EnvironmentConfigurator(testServices) { + companion object { + private val NOARG_ANNOTATIONS = listOf("NoArg", "NoArg2", "test.NoArg") + } + + override val directiveContainers: List = listOf(NoArgDirectives) + + override fun registerCompilerExtensions(project: Project, module: TestModule, configuration: CompilerConfiguration) { NoArgComponentRegistrar.registerNoArgComponents( - myEnvironment.project, + project, NOARG_ANNOTATIONS, - backend.isIR, - files.any { it.directives.contains("INVOKE_INITIALIZERS") }, + useIr = module.targetBackend?.isIR == true, + invokeInitializers = NoArgDirectives.INVOKE_INITIALIZERS in module.directives ) - - super.loadMultiFiles(files) } } -@OptIn(ObsoleteTestInfrastructure::class) -abstract class AbstractBytecodeListingTestForNoArg : AbstractBytecodeListingTest() { - override fun setupEnvironment(environment: KotlinCoreEnvironment) { - NoArgComponentRegistrar.registerNoArgComponents(environment.project, NOARG_ANNOTATIONS, backend.isIR, false) - } -} - -abstract class AbstractIrBlackBoxCodegenTestForNoArg : AbstractBlackBoxCodegenTestForNoArg() { - override val backend: TargetBackend get() = TargetBackend.JVM_IR -} - -abstract class AbstractIrBytecodeListingTestForNoArg : AbstractBytecodeListingTestForNoArg() { - override val backend: TargetBackend get() = TargetBackend.JVM_IR -} - -@OptIn(ObsoleteTestInfrastructure::class) -abstract class AbstractDiagnosticsTestForNoArg : AbstractDiagnosticsTest() { - override fun setupEnvironment(environment: KotlinCoreEnvironment) { - NoArgComponentRegistrar.registerNoArgComponents(environment.project, NOARG_ANNOTATIONS, backend.isIR, false) - } +object NoArgDirectives : SimpleDirectivesContainer() { + val INVOKE_INITIALIZERS by directive("Enable 'Invoke initializers' mode") } diff --git a/plugins/noarg/testData/bytecodeListing/annoOnNotClass.txt b/plugins/noarg/testData/bytecodeListing/annoOnNotClass.txt index ea28d505801..0ea86e421b1 100644 --- a/plugins/noarg/testData/bytecodeListing/annoOnNotClass.txt +++ b/plugins/noarg/testData/bytecodeListing/annoOnNotClass.txt @@ -28,7 +28,7 @@ public final class MyClass { } @NoArg -@java.lang.annotation.Retention +@java.lang.annotation.Retention(value=RUNTIME) @kotlin.Metadata public annotation class NoArg { // source: 'annoOnNotClass.kt' diff --git a/plugins/noarg/testData/bytecodeListing/annoOnNotClass_ir.txt b/plugins/noarg/testData/bytecodeListing/annoOnNotClass_ir.txt index 630566ca6c5..159876d603a 100644 --- a/plugins/noarg/testData/bytecodeListing/annoOnNotClass_ir.txt +++ b/plugins/noarg/testData/bytecodeListing/annoOnNotClass_ir.txt @@ -29,7 +29,7 @@ public final class MyClass { } @NoArg -@java.lang.annotation.Retention +@java.lang.annotation.Retention(value=RUNTIME) @kotlin.Metadata public annotation class NoArg { // source: 'annoOnNotClass.kt' diff --git a/plugins/noarg/testData/bytecodeListing/constructorVisibility.txt b/plugins/noarg/testData/bytecodeListing/constructorVisibility.txt index 4ad1088a004..3cdf6a009d0 100644 --- a/plugins/noarg/testData/bytecodeListing/constructorVisibility.txt +++ b/plugins/noarg/testData/bytecodeListing/constructorVisibility.txt @@ -6,7 +6,7 @@ public final class Internal { public method (p0: boolean): void } -@java.lang.annotation.Retention +@java.lang.annotation.Retention(value=RUNTIME) @kotlin.Metadata public annotation class NoArg { // source: 'constructorVisibility.kt' diff --git a/plugins/noarg/testData/bytecodeListing/defaultParameters.txt b/plugins/noarg/testData/bytecodeListing/defaultParameters.txt index 1dbd092d1ab..586ade42e4d 100644 --- a/plugins/noarg/testData/bytecodeListing/defaultParameters.txt +++ b/plugins/noarg/testData/bytecodeListing/defaultParameters.txt @@ -5,13 +5,13 @@ public interface BaseIntf { } @NoArg -@java.lang.annotation.Retention +@java.lang.annotation.Retention(value=RUNTIME) @kotlin.Metadata public annotation class MetaAnno { // source: 'defaultParameters.kt' } -@java.lang.annotation.Retention +@java.lang.annotation.Retention(value=RUNTIME) @kotlin.Metadata public annotation class NoArg { // source: 'defaultParameters.kt' diff --git a/plugins/noarg/testData/bytecodeListing/inherited.txt b/plugins/noarg/testData/bytecodeListing/inherited.txt index 31f87198fc3..4973357056d 100644 --- a/plugins/noarg/testData/bytecodeListing/inherited.txt +++ b/plugins/noarg/testData/bytecodeListing/inherited.txt @@ -5,13 +5,13 @@ public interface Base { } @NoArg -@java.lang.annotation.Retention +@java.lang.annotation.Retention(value=RUNTIME) @kotlin.Metadata public annotation class MyAnno { // source: 'inherited.kt' } -@java.lang.annotation.Retention +@java.lang.annotation.Retention(value=RUNTIME) @kotlin.Metadata public annotation class NoArg { // source: 'inherited.kt' diff --git a/plugins/noarg/testData/bytecodeListing/nestedClass.txt b/plugins/noarg/testData/bytecodeListing/nestedClass.txt index 75f43398ee4..5195d79d523 100644 --- a/plugins/noarg/testData/bytecodeListing/nestedClass.txt +++ b/plugins/noarg/testData/bytecodeListing/nestedClass.txt @@ -1,4 +1,4 @@ -@java.lang.annotation.Retention +@java.lang.annotation.Retention(value=RUNTIME) @kotlin.Metadata public annotation class NoArg { // source: 'nestedClass.kt' diff --git a/plugins/noarg/testData/bytecodeListing/noNoArg.txt b/plugins/noarg/testData/bytecodeListing/noNoArg.txt index 7faaba4fa95..5c77adf4308 100644 --- a/plugins/noarg/testData/bytecodeListing/noNoArg.txt +++ b/plugins/noarg/testData/bytecodeListing/noNoArg.txt @@ -1,4 +1,4 @@ -@java.lang.annotation.Retention +@java.lang.annotation.Retention(value=RUNTIME) @kotlin.Metadata public annotation class NoArg { // source: 'noNoArg.kt' diff --git a/plugins/noarg/testData/bytecodeListing/severalNoArg.txt b/plugins/noarg/testData/bytecodeListing/severalNoArg.txt index 904a99605ea..a0f49c054fc 100644 --- a/plugins/noarg/testData/bytecodeListing/severalNoArg.txt +++ b/plugins/noarg/testData/bytecodeListing/severalNoArg.txt @@ -1,10 +1,10 @@ -@java.lang.annotation.Retention +@java.lang.annotation.Retention(value=RUNTIME) @kotlin.Metadata public annotation class NoArg { // source: 'severalNoArg.kt' } -@java.lang.annotation.Retention +@java.lang.annotation.Retention(value=RUNTIME) @kotlin.Metadata public annotation class NoArg2 { // source: 'severalNoArg.kt' diff --git a/plugins/noarg/testData/bytecodeListing/simple.txt b/plugins/noarg/testData/bytecodeListing/simple.txt index c88887d21a9..b5641a92061 100644 --- a/plugins/noarg/testData/bytecodeListing/simple.txt +++ b/plugins/noarg/testData/bytecodeListing/simple.txt @@ -1,4 +1,4 @@ -@java.lang.annotation.Retention +@java.lang.annotation.Retention(value=RUNTIME) @kotlin.Metadata public annotation class NoArg { // source: 'simple.kt' diff --git a/plugins/noarg/testData/bytecodeListing/superTypes.txt b/plugins/noarg/testData/bytecodeListing/superTypes.txt index b9dd289e3dd..ac2c7591f31 100644 --- a/plugins/noarg/testData/bytecodeListing/superTypes.txt +++ b/plugins/noarg/testData/bytecodeListing/superTypes.txt @@ -18,7 +18,7 @@ public final class MyClass { public method (@org.jetbrains.annotations.NotNull p0: java.lang.String): void } -@java.lang.annotation.Retention +@java.lang.annotation.Retention(value=RUNTIME) @kotlin.Metadata public annotation class NoArg { // source: 'superTypes.kt' diff --git a/plugins/noarg/testData/diagnostics/innerClass.kt b/plugins/noarg/testData/diagnostics/innerClass.kt index f7bbfb9d26c..e2969727f92 100644 --- a/plugins/noarg/testData/diagnostics/innerClass.kt +++ b/plugins/noarg/testData/diagnostics/innerClass.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL annotation class NoArg class Outer { diff --git a/plugins/noarg/testData/diagnostics/noNoargCtorInSuperclass.kt b/plugins/noarg/testData/diagnostics/noNoargCtorInSuperclass.kt index 46a160ea2a5..aa164068e50 100644 --- a/plugins/noarg/testData/diagnostics/noNoargCtorInSuperclass.kt +++ b/plugins/noarg/testData/diagnostics/noNoargCtorInSuperclass.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL annotation class NoArg open class Base(val s: String) diff --git a/plugins/noarg/test/org/jetbrains/kotlin/noarg/BlackBoxCodegenTestForNoArgGenerated.java b/plugins/noarg/tests-gen/org/jetbrains/kotlin/noarg/BlackBoxCodegenTestForNoArgGenerated.java similarity index 56% rename from plugins/noarg/test/org/jetbrains/kotlin/noarg/BlackBoxCodegenTestForNoArgGenerated.java rename to plugins/noarg/tests-gen/org/jetbrains/kotlin/noarg/BlackBoxCodegenTestForNoArgGenerated.java index 143764a08fa..f3163d487d9 100644 --- a/plugins/noarg/test/org/jetbrains/kotlin/noarg/BlackBoxCodegenTestForNoArgGenerated.java +++ b/plugins/noarg/tests-gen/org/jetbrains/kotlin/noarg/BlackBoxCodegenTestForNoArgGenerated.java @@ -6,77 +6,82 @@ package org.jetbrains.kotlin.noarg; 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/noarg/noarg-cli/testData/box") +@TestMetadata("plugins/noarg/testData/box") @TestDataPath("$PROJECT_ROOT") -@RunWith(JUnit3RunnerWithInners.class) public class BlackBoxCodegenTestForNoArgGenerated extends AbstractBlackBoxCodegenTestForNoArg { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + @Test public void testAllFilesPresentInBox() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("plugins/noarg/noarg-cli/testData/box"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("plugins/noarg/testData/box"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("initializers.kt") public void testInitializers() throws Exception { - runTest("plugins/noarg/noarg-cli/testData/box/initializers.kt"); + runTest("plugins/noarg/testData/box/initializers.kt"); } + @Test @TestMetadata("initializersWithoutInvokeInitializers.kt") public void testInitializersWithoutInvokeInitializers() throws Exception { - runTest("plugins/noarg/noarg-cli/testData/box/initializersWithoutInvokeInitializers.kt"); + runTest("plugins/noarg/testData/box/initializersWithoutInvokeInitializers.kt"); } + @Test @TestMetadata("kt18245.kt") public void testKt18245() throws Exception { - runTest("plugins/noarg/noarg-cli/testData/box/kt18245.kt"); + runTest("plugins/noarg/testData/box/kt18245.kt"); } + @Test @TestMetadata("kt18667.kt") public void testKt18667() throws Exception { - runTest("plugins/noarg/noarg-cli/testData/box/kt18667.kt"); + runTest("plugins/noarg/testData/box/kt18667.kt"); } + @Test @TestMetadata("kt18668.kt") public void testKt18668() throws Exception { - runTest("plugins/noarg/noarg-cli/testData/box/kt18668.kt"); + runTest("plugins/noarg/testData/box/kt18668.kt"); } + @Test @TestMetadata("localClassInInitiailzer.kt") public void testLocalClassInInitiailzer() throws Exception { - runTest("plugins/noarg/noarg-cli/testData/box/localClassInInitiailzer.kt"); + runTest("plugins/noarg/testData/box/localClassInInitiailzer.kt"); } + @Test @TestMetadata("nestedClass.kt") public void testNestedClass() throws Exception { - runTest("plugins/noarg/noarg-cli/testData/box/nestedClass.kt"); + runTest("plugins/noarg/testData/box/nestedClass.kt"); } + @Test @TestMetadata("sealedClassWithExistingNoargCtor.kt") public void testSealedClassWithExistingNoargCtor() throws Exception { - runTest("plugins/noarg/noarg-cli/testData/box/sealedClassWithExistingNoargCtor.kt"); + runTest("plugins/noarg/testData/box/sealedClassWithExistingNoargCtor.kt"); } + @Test @TestMetadata("simple.kt") public void testSimple() throws Exception { - runTest("plugins/noarg/noarg-cli/testData/box/simple.kt"); + runTest("plugins/noarg/testData/box/simple.kt"); } + @Test @TestMetadata("subclass.kt") public void testSubclass() throws Exception { - runTest("plugins/noarg/noarg-cli/testData/box/subclass.kt"); + runTest("plugins/noarg/testData/box/subclass.kt"); } } diff --git a/plugins/noarg/test/org/jetbrains/kotlin/noarg/BytecodeListingTestForNoArgGenerated.java b/plugins/noarg/tests-gen/org/jetbrains/kotlin/noarg/BytecodeListingTestForNoArgGenerated.java similarity index 53% rename from plugins/noarg/test/org/jetbrains/kotlin/noarg/BytecodeListingTestForNoArgGenerated.java rename to plugins/noarg/tests-gen/org/jetbrains/kotlin/noarg/BytecodeListingTestForNoArgGenerated.java index b74b58e03e8..33badb226c3 100644 --- a/plugins/noarg/test/org/jetbrains/kotlin/noarg/BytecodeListingTestForNoArgGenerated.java +++ b/plugins/noarg/tests-gen/org/jetbrains/kotlin/noarg/BytecodeListingTestForNoArgGenerated.java @@ -6,72 +6,76 @@ package org.jetbrains.kotlin.noarg; 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/noarg/noarg-cli/testData/bytecodeListing") +@TestMetadata("plugins/noarg/testData/bytecodeListing") @TestDataPath("$PROJECT_ROOT") -@RunWith(JUnit3RunnerWithInners.class) public class BytecodeListingTestForNoArgGenerated extends AbstractBytecodeListingTestForNoArg { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + @Test public void testAllFilesPresentInBytecodeListing() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("plugins/noarg/noarg-cli/testData/bytecodeListing"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("plugins/noarg/testData/bytecodeListing"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), TargetBackend.JVM, true); } + @Test @TestMetadata("annoOnNotClass.kt") public void testAnnoOnNotClass() throws Exception { - runTest("plugins/noarg/noarg-cli/testData/bytecodeListing/annoOnNotClass.kt"); + runTest("plugins/noarg/testData/bytecodeListing/annoOnNotClass.kt"); } + @Test @TestMetadata("constructorVisibility.kt") public void testConstructorVisibility() throws Exception { - runTest("plugins/noarg/noarg-cli/testData/bytecodeListing/constructorVisibility.kt"); + runTest("plugins/noarg/testData/bytecodeListing/constructorVisibility.kt"); } + @Test @TestMetadata("defaultParameters.kt") public void testDefaultParameters() throws Exception { - runTest("plugins/noarg/noarg-cli/testData/bytecodeListing/defaultParameters.kt"); + runTest("plugins/noarg/testData/bytecodeListing/defaultParameters.kt"); } + @Test @TestMetadata("inherited.kt") public void testInherited() throws Exception { - runTest("plugins/noarg/noarg-cli/testData/bytecodeListing/inherited.kt"); + runTest("plugins/noarg/testData/bytecodeListing/inherited.kt"); } + @Test @TestMetadata("nestedClass.kt") public void testNestedClass() throws Exception { - runTest("plugins/noarg/noarg-cli/testData/bytecodeListing/nestedClass.kt"); + runTest("plugins/noarg/testData/bytecodeListing/nestedClass.kt"); } + @Test @TestMetadata("noNoArg.kt") public void testNoNoArg() throws Exception { - runTest("plugins/noarg/noarg-cli/testData/bytecodeListing/noNoArg.kt"); + runTest("plugins/noarg/testData/bytecodeListing/noNoArg.kt"); } + @Test @TestMetadata("severalNoArg.kt") public void testSeveralNoArg() throws Exception { - runTest("plugins/noarg/noarg-cli/testData/bytecodeListing/severalNoArg.kt"); + runTest("plugins/noarg/testData/bytecodeListing/severalNoArg.kt"); } + @Test @TestMetadata("simple.kt") public void testSimple() throws Exception { - runTest("plugins/noarg/noarg-cli/testData/bytecodeListing/simple.kt"); + runTest("plugins/noarg/testData/bytecodeListing/simple.kt"); } + @Test @TestMetadata("superTypes.kt") public void testSuperTypes() throws Exception { - runTest("plugins/noarg/noarg-cli/testData/bytecodeListing/superTypes.kt"); + runTest("plugins/noarg/testData/bytecodeListing/superTypes.kt"); } } diff --git a/plugins/noarg/test/org/jetbrains/kotlin/noarg/DiagnosticsTestForNoArgGenerated.java b/plugins/noarg/tests-gen/org/jetbrains/kotlin/noarg/DiagnosticsTestForNoArgGenerated.java similarity index 54% rename from plugins/noarg/test/org/jetbrains/kotlin/noarg/DiagnosticsTestForNoArgGenerated.java rename to plugins/noarg/tests-gen/org/jetbrains/kotlin/noarg/DiagnosticsTestForNoArgGenerated.java index 2ed8c05308d..334bd328b0e 100644 --- a/plugins/noarg/test/org/jetbrains/kotlin/noarg/DiagnosticsTestForNoArgGenerated.java +++ b/plugins/noarg/tests-gen/org/jetbrains/kotlin/noarg/DiagnosticsTestForNoArgGenerated.java @@ -6,36 +6,33 @@ package org.jetbrains.kotlin.noarg; 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.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/noarg/noarg-cli/testData/diagnostics") +@TestMetadata("plugins/noarg/testData/diagnostics") @TestDataPath("$PROJECT_ROOT") -@RunWith(JUnit3RunnerWithInners.class) public class DiagnosticsTestForNoArgGenerated extends AbstractDiagnosticsTestForNoArg { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + @Test public void testAllFilesPresentInDiagnostics() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("plugins/noarg/noarg-cli/testData/diagnostics"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("plugins/noarg/testData/diagnostics"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Test @TestMetadata("innerClass.kt") public void testInnerClass() throws Exception { - runTest("plugins/noarg/noarg-cli/testData/diagnostics/innerClass.kt"); + runTest("plugins/noarg/testData/diagnostics/innerClass.kt"); } + @Test @TestMetadata("noNoargCtorInSuperclass.kt") public void testNoNoargCtorInSuperclass() throws Exception { - runTest("plugins/noarg/noarg-cli/testData/diagnostics/noNoargCtorInSuperclass.kt"); + runTest("plugins/noarg/testData/diagnostics/noNoargCtorInSuperclass.kt"); } } diff --git a/plugins/noarg/test/org/jetbrains/kotlin/noarg/IrBlackBoxCodegenTestForNoArgGenerated.java b/plugins/noarg/tests-gen/org/jetbrains/kotlin/noarg/IrBlackBoxCodegenTestForNoArgGenerated.java similarity index 56% rename from plugins/noarg/test/org/jetbrains/kotlin/noarg/IrBlackBoxCodegenTestForNoArgGenerated.java rename to plugins/noarg/tests-gen/org/jetbrains/kotlin/noarg/IrBlackBoxCodegenTestForNoArgGenerated.java index dffc0401dfe..564d873be22 100644 --- a/plugins/noarg/test/org/jetbrains/kotlin/noarg/IrBlackBoxCodegenTestForNoArgGenerated.java +++ b/plugins/noarg/tests-gen/org/jetbrains/kotlin/noarg/IrBlackBoxCodegenTestForNoArgGenerated.java @@ -6,77 +6,82 @@ package org.jetbrains.kotlin.noarg; 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/noarg/noarg-cli/testData/box") +@TestMetadata("plugins/noarg/testData/box") @TestDataPath("$PROJECT_ROOT") -@RunWith(JUnit3RunnerWithInners.class) public class IrBlackBoxCodegenTestForNoArgGenerated extends AbstractIrBlackBoxCodegenTestForNoArg { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + @Test public void testAllFilesPresentInBox() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("plugins/noarg/noarg-cli/testData/box"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("plugins/noarg/testData/box"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("initializers.kt") public void testInitializers() throws Exception { - runTest("plugins/noarg/noarg-cli/testData/box/initializers.kt"); + runTest("plugins/noarg/testData/box/initializers.kt"); } + @Test @TestMetadata("initializersWithoutInvokeInitializers.kt") public void testInitializersWithoutInvokeInitializers() throws Exception { - runTest("plugins/noarg/noarg-cli/testData/box/initializersWithoutInvokeInitializers.kt"); + runTest("plugins/noarg/testData/box/initializersWithoutInvokeInitializers.kt"); } + @Test @TestMetadata("kt18245.kt") public void testKt18245() throws Exception { - runTest("plugins/noarg/noarg-cli/testData/box/kt18245.kt"); + runTest("plugins/noarg/testData/box/kt18245.kt"); } + @Test @TestMetadata("kt18667.kt") public void testKt18667() throws Exception { - runTest("plugins/noarg/noarg-cli/testData/box/kt18667.kt"); + runTest("plugins/noarg/testData/box/kt18667.kt"); } + @Test @TestMetadata("kt18668.kt") public void testKt18668() throws Exception { - runTest("plugins/noarg/noarg-cli/testData/box/kt18668.kt"); + runTest("plugins/noarg/testData/box/kt18668.kt"); } + @Test @TestMetadata("localClassInInitiailzer.kt") public void testLocalClassInInitiailzer() throws Exception { - runTest("plugins/noarg/noarg-cli/testData/box/localClassInInitiailzer.kt"); + runTest("plugins/noarg/testData/box/localClassInInitiailzer.kt"); } + @Test @TestMetadata("nestedClass.kt") public void testNestedClass() throws Exception { - runTest("plugins/noarg/noarg-cli/testData/box/nestedClass.kt"); + runTest("plugins/noarg/testData/box/nestedClass.kt"); } + @Test @TestMetadata("sealedClassWithExistingNoargCtor.kt") public void testSealedClassWithExistingNoargCtor() throws Exception { - runTest("plugins/noarg/noarg-cli/testData/box/sealedClassWithExistingNoargCtor.kt"); + runTest("plugins/noarg/testData/box/sealedClassWithExistingNoargCtor.kt"); } + @Test @TestMetadata("simple.kt") public void testSimple() throws Exception { - runTest("plugins/noarg/noarg-cli/testData/box/simple.kt"); + runTest("plugins/noarg/testData/box/simple.kt"); } + @Test @TestMetadata("subclass.kt") public void testSubclass() throws Exception { - runTest("plugins/noarg/noarg-cli/testData/box/subclass.kt"); + runTest("plugins/noarg/testData/box/subclass.kt"); } } diff --git a/plugins/noarg/test/org/jetbrains/kotlin/noarg/IrBytecodeListingTestForNoArgGenerated.java b/plugins/noarg/tests-gen/org/jetbrains/kotlin/noarg/IrBytecodeListingTestForNoArgGenerated.java similarity index 53% rename from plugins/noarg/test/org/jetbrains/kotlin/noarg/IrBytecodeListingTestForNoArgGenerated.java rename to plugins/noarg/tests-gen/org/jetbrains/kotlin/noarg/IrBytecodeListingTestForNoArgGenerated.java index 64198929455..2604898a8b1 100644 --- a/plugins/noarg/test/org/jetbrains/kotlin/noarg/IrBytecodeListingTestForNoArgGenerated.java +++ b/plugins/noarg/tests-gen/org/jetbrains/kotlin/noarg/IrBytecodeListingTestForNoArgGenerated.java @@ -6,72 +6,76 @@ package org.jetbrains.kotlin.noarg; 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/noarg/noarg-cli/testData/bytecodeListing") +@TestMetadata("plugins/noarg/testData/bytecodeListing") @TestDataPath("$PROJECT_ROOT") -@RunWith(JUnit3RunnerWithInners.class) public class IrBytecodeListingTestForNoArgGenerated extends AbstractIrBytecodeListingTestForNoArg { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + @Test public void testAllFilesPresentInBytecodeListing() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("plugins/noarg/noarg-cli/testData/bytecodeListing"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("plugins/noarg/testData/bytecodeListing"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), TargetBackend.JVM_IR, true); } + @Test @TestMetadata("annoOnNotClass.kt") public void testAnnoOnNotClass() throws Exception { - runTest("plugins/noarg/noarg-cli/testData/bytecodeListing/annoOnNotClass.kt"); + runTest("plugins/noarg/testData/bytecodeListing/annoOnNotClass.kt"); } + @Test @TestMetadata("constructorVisibility.kt") public void testConstructorVisibility() throws Exception { - runTest("plugins/noarg/noarg-cli/testData/bytecodeListing/constructorVisibility.kt"); + runTest("plugins/noarg/testData/bytecodeListing/constructorVisibility.kt"); } + @Test @TestMetadata("defaultParameters.kt") public void testDefaultParameters() throws Exception { - runTest("plugins/noarg/noarg-cli/testData/bytecodeListing/defaultParameters.kt"); + runTest("plugins/noarg/testData/bytecodeListing/defaultParameters.kt"); } + @Test @TestMetadata("inherited.kt") public void testInherited() throws Exception { - runTest("plugins/noarg/noarg-cli/testData/bytecodeListing/inherited.kt"); + runTest("plugins/noarg/testData/bytecodeListing/inherited.kt"); } + @Test @TestMetadata("nestedClass.kt") public void testNestedClass() throws Exception { - runTest("plugins/noarg/noarg-cli/testData/bytecodeListing/nestedClass.kt"); + runTest("plugins/noarg/testData/bytecodeListing/nestedClass.kt"); } + @Test @TestMetadata("noNoArg.kt") public void testNoNoArg() throws Exception { - runTest("plugins/noarg/noarg-cli/testData/bytecodeListing/noNoArg.kt"); + runTest("plugins/noarg/testData/bytecodeListing/noNoArg.kt"); } + @Test @TestMetadata("severalNoArg.kt") public void testSeveralNoArg() throws Exception { - runTest("plugins/noarg/noarg-cli/testData/bytecodeListing/severalNoArg.kt"); + runTest("plugins/noarg/testData/bytecodeListing/severalNoArg.kt"); } + @Test @TestMetadata("simple.kt") public void testSimple() throws Exception { - runTest("plugins/noarg/noarg-cli/testData/bytecodeListing/simple.kt"); + runTest("plugins/noarg/testData/bytecodeListing/simple.kt"); } + @Test @TestMetadata("superTypes.kt") public void testSuperTypes() throws Exception { - runTest("plugins/noarg/noarg-cli/testData/bytecodeListing/superTypes.kt"); + runTest("plugins/noarg/testData/bytecodeListing/superTypes.kt"); } }