From 9a2e4c6b415d3456320c9bc39985308e32c32700 Mon Sep 17 00:00:00 2001 From: Iaroslav Postovalov Date: Mon, 15 Jan 2024 18:09:34 +0100 Subject: [PATCH] [Tests] FIR support in JUnit 3 tests, port necessary subclasses ^KT-64404 Fixed ^KT-64438 Fixed ^KT-64407 Fixed --- .../AbstractIrCompileKotlinAgainstKlibTest.kt | 5 +- .../checkers/KotlinMultiFileTestWithJava.kt | 1 - ...ractIrKapt3BuilderModeBytecodeShapeTest.kt | 3 +- .../codegen/AbstractLightAnalysisModeTest.kt | 4 +- .../kotlin/codegen/CodegenTestCase.java | 6 +- ...ava => GenerateNotNullAssertionsTest.java} | 6 +- .../fir/AbstractFirLightTreeWriteFlagsTest.kt | 16 + .../AbstractFirLightTreeWriteSignatureTest.kt | 17 + .../fir/AbstractFirPsiWriteFlagsTest.kt | 16 + .../fir/AbstractFirPsiWriteSignatureTest.kt | 17 + ...bstractComposeLikeIrBlackBoxCodegenTest.kt | 3 +- .../AbstractComposeLikeIrBytecodeTextTest.kt | 3 +- .../AbstractIrCheckLocalVariablesTableTest.kt | 3 +- .../codegen/ir/AbstractIrScriptCodegenTest.kt | 3 +- .../codegen/ir/AbstractIrWriteFlagsTest.kt | 3 +- .../ir/AbstractIrWriteSignatureTest.kt | 3 +- .../kotlin/ir/AbstractIrGeneratorTestCase.kt | 2 +- .../AbstractCompileJavaAgainstKotlinTest.kt | 10 +- .../AbstractCompileKotlinAgainstJavaTest.kt | 7 +- ...AbstractFirCompileJavaAgainstKotlinTest.kt | 27 - .../jvm/compiler/AbstractLoadJavaTest.java | 2 +- ...AbstractLoadJavaWithPsiClassReadingTest.kt | 9 +- ...irLightTreeCompileJavaAgainstKotlinTest.kt | 17 + ...tractFirPsiCompileJavaAgainstKotlinTest.kt | 17 + ...irLightTreeCompileJavaAgainstKotlinTest.kt | 10 - ...tractFirPsiCompileJavaAgainstKotlinTest.kt | 10 - .../AbstractIrCompileJavaAgainstKotlinTest.kt | 6 +- .../AbstractIrCompileKotlinAgainstJavaTest.kt | 6 +- .../jvm/compiler/ir/AbstractIrLoadJavaTest.kt | 6 +- .../kotlin/klib/AbstractKlibIrTextTestCase.kt | 2 +- .../jetbrains/kotlin/test/KotlinBaseTest.kt | 10 +- .../FrontendBackendConfiguration.kt | 30 + .../generators/GenerateJUnit3CompilerTests.kt | 43 + ...faultArgumentsReflectionTestGenerated.java | 92 ++ ...faultArgumentsReflectionTestGenerated.java | 92 ++ ...faultArgumentsReflectionTestGenerated.java | 92 ++ ...CheckLocalVariablesTableTestGenerated.java | 135 ++ .../FirLightTreeWriteFlagsTestGenerated.java | 1288 +++++++++++++++++ ...rLightTreeWriteSignatureTestGenerated.java | 683 +++++++++ ...CheckLocalVariablesTableTestGenerated.java | 135 ++ .../fir/FirPsiWriteFlagsTestGenerated.java | 1288 +++++++++++++++++ .../FirPsiWriteSignatureTestGenerated.java | 683 +++++++++ ...CompileJavaAgainstKotlinTestGenerated.java | 2 +- ...CompileJavaAgainstKotlinTestGenerated.java | 2 +- .../AbstractCustomScriptCodegenTest.kt | 3 +- .../kotlin/codegen/ControlStructuresTest.java | 2 +- .../kotlin/codegen/CustomBytecodeTextTest.kt | 8 +- .../kotlin/codegen/CustomScriptCodegenTest.kt | 9 +- .../GenerateNotNullAssertionsTest.java | 12 - .../kotlin/codegen/MethodOrderTest.kt | 19 +- .../codegen/ReflectionClassLoaderTest.kt | 2 +- ...LightTreeDefaultArgumentsReflectionTest.kt | 17 + ...actFirPsiDefaultArgumentsReflectionTest.kt | 17 + ...bstractIrDefaultArgumentsReflectionTest.kt | 14 + .../fir/FirLightTreeCodegenTestCase.kt | 172 +++ .../codegen/fir/FirPsiCodegenTestCase.kt | 172 +++ .../kotlin/codegen/ir/IrCodegenTestCase.kt | 268 ++++ .../codegen/ir/IrCustomBytecodeTextTest.kt | 58 + .../ir/IrGenerateNotNullAssertionsTest.java | 11 +- .../jvm/compiler/JvmIrLinkageModeTest.kt | 2 +- .../fir/FirPsiJvmIrLinkageModeTest.kt | 18 + .../jvm/compiler/ir/IrJvmIrLinkageModeTest.kt | 15 + .../AbstractJvmVersionRequirementTest.kt | 56 + .../JvmVersionRequirementTest.kt | 146 -- .../K1JvmVersionRequirementTest.kt | 101 ++ .../K2JvmVersionRequirementTest.kt | 17 + 66 files changed, 5681 insertions(+), 273 deletions(-) rename compiler/tests-common/tests/org/jetbrains/kotlin/codegen/{AbstractGenerateNotNullAssertionsTest.java => GenerateNotNullAssertionsTest.java} (95%) create mode 100644 compiler/tests-common/tests/org/jetbrains/kotlin/codegen/fir/AbstractFirLightTreeWriteFlagsTest.kt create mode 100644 compiler/tests-common/tests/org/jetbrains/kotlin/codegen/fir/AbstractFirLightTreeWriteSignatureTest.kt create mode 100644 compiler/tests-common/tests/org/jetbrains/kotlin/codegen/fir/AbstractFirPsiWriteFlagsTest.kt create mode 100644 compiler/tests-common/tests/org/jetbrains/kotlin/codegen/fir/AbstractFirPsiWriteSignatureTest.kt delete mode 100644 compiler/tests-common/tests/org/jetbrains/kotlin/jvm/compiler/AbstractFirCompileJavaAgainstKotlinTest.kt create mode 100644 compiler/tests-common/tests/org/jetbrains/kotlin/jvm/compiler/fir/AbstractFirLightTreeCompileJavaAgainstKotlinTest.kt create mode 100644 compiler/tests-common/tests/org/jetbrains/kotlin/jvm/compiler/fir/AbstractFirPsiCompileJavaAgainstKotlinTest.kt delete mode 100644 compiler/tests-common/tests/org/jetbrains/kotlin/jvm/compiler/ir/AbstractFirLightTreeCompileJavaAgainstKotlinTest.kt delete mode 100644 compiler/tests-common/tests/org/jetbrains/kotlin/jvm/compiler/ir/AbstractFirPsiCompileJavaAgainstKotlinTest.kt create mode 100644 compiler/tests-common/tests/org/jetbrains/kotlin/test/testFramework/FrontendBackendConfiguration.kt create mode 100644 compiler/tests-gen/org/jetbrains/kotlin/codegen/defaultConstructor/fir/FirLightTreeDefaultArgumentsReflectionTestGenerated.java create mode 100644 compiler/tests-gen/org/jetbrains/kotlin/codegen/defaultConstructor/fir/FirPsiDefaultArgumentsReflectionTestGenerated.java create mode 100644 compiler/tests-gen/org/jetbrains/kotlin/codegen/defaultConstructor/ir/IrDefaultArgumentsReflectionTestGenerated.java create mode 100644 compiler/tests-gen/org/jetbrains/kotlin/codegen/fir/FirLightTreeCheckLocalVariablesTableTestGenerated.java create mode 100644 compiler/tests-gen/org/jetbrains/kotlin/codegen/fir/FirLightTreeWriteFlagsTestGenerated.java create mode 100644 compiler/tests-gen/org/jetbrains/kotlin/codegen/fir/FirLightTreeWriteSignatureTestGenerated.java create mode 100644 compiler/tests-gen/org/jetbrains/kotlin/codegen/fir/FirPsiCheckLocalVariablesTableTestGenerated.java create mode 100644 compiler/tests-gen/org/jetbrains/kotlin/codegen/fir/FirPsiWriteFlagsTestGenerated.java create mode 100644 compiler/tests-gen/org/jetbrains/kotlin/codegen/fir/FirPsiWriteSignatureTestGenerated.java rename compiler/tests-gen/org/jetbrains/kotlin/jvm/compiler/{ir => fir}/FirLightTreeCompileJavaAgainstKotlinTestGenerated.java (99%) rename compiler/tests-gen/org/jetbrains/kotlin/jvm/compiler/{ir => fir}/FirPsiCompileJavaAgainstKotlinTestGenerated.java (99%) delete mode 100644 compiler/tests/org/jetbrains/kotlin/codegen/GenerateNotNullAssertionsTest.java create mode 100644 compiler/tests/org/jetbrains/kotlin/codegen/defaultConstructor/fir/AbstractFirLightTreeDefaultArgumentsReflectionTest.kt create mode 100644 compiler/tests/org/jetbrains/kotlin/codegen/defaultConstructor/fir/AbstractFirPsiDefaultArgumentsReflectionTest.kt create mode 100644 compiler/tests/org/jetbrains/kotlin/codegen/defaultConstructor/ir/AbstractIrDefaultArgumentsReflectionTest.kt create mode 100644 compiler/tests/org/jetbrains/kotlin/codegen/fir/FirLightTreeCodegenTestCase.kt create mode 100644 compiler/tests/org/jetbrains/kotlin/codegen/fir/FirPsiCodegenTestCase.kt create mode 100644 compiler/tests/org/jetbrains/kotlin/codegen/ir/IrCodegenTestCase.kt create mode 100644 compiler/tests/org/jetbrains/kotlin/codegen/ir/IrCustomBytecodeTextTest.kt create mode 100644 compiler/tests/org/jetbrains/kotlin/jvm/compiler/fir/FirPsiJvmIrLinkageModeTest.kt create mode 100644 compiler/tests/org/jetbrains/kotlin/jvm/compiler/ir/IrJvmIrLinkageModeTest.kt create mode 100644 compiler/tests/org/jetbrains/kotlin/serialization/AbstractJvmVersionRequirementTest.kt delete mode 100644 compiler/tests/org/jetbrains/kotlin/serialization/JvmVersionRequirementTest.kt create mode 100644 compiler/tests/org/jetbrains/kotlin/serialization/K1JvmVersionRequirementTest.kt create mode 100644 compiler/tests/org/jetbrains/kotlin/serialization/K2JvmVersionRequirementTest.kt diff --git a/compiler/tests-against-klib/tests/org/jetbrains/kotlin/codegen/ir/AbstractIrCompileKotlinAgainstKlibTest.kt b/compiler/tests-against-klib/tests/org/jetbrains/kotlin/codegen/ir/AbstractIrCompileKotlinAgainstKlibTest.kt index d8e1f3edd04..3fb9aee549d 100644 --- a/compiler/tests-against-klib/tests/org/jetbrains/kotlin/codegen/ir/AbstractIrCompileKotlinAgainstKlibTest.kt +++ b/compiler/tests-against-klib/tests/org/jetbrains/kotlin/codegen/ir/AbstractIrCompileKotlinAgainstKlibTest.kt @@ -26,7 +26,8 @@ abstract class AbstractCompileKotlinAgainstKlibTest : AbstractBlackBoxCodegenTes lateinit var outputDir: File lateinit var klibPath: String - override val backend = TargetBackend.JVM_IR + override val backend + get() = TargetBackend.JVM_IR override fun doMultiFileTest(wholeFile: File, files: List) { outputDir = javaSourcesOutputDirectory @@ -36,7 +37,7 @@ abstract class AbstractCompileKotlinAgainstKlibTest : AbstractBlackBoxCodegenTes val classpath: MutableList = ArrayList() classpath.add(KtTestUtil.getAnnotationsJar()) val configuration = createConfiguration( - configurationKind, getTestJdkKind(files), backend, classpath, listOf(outputDir), files + configurationKind, getTestJdkKind(files), classpath, listOf(outputDir), files ) myEnvironment = createForTests( testRootDisposable, configuration, EnvironmentConfigFiles.JVM_CONFIG_FILES diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/checkers/KotlinMultiFileTestWithJava.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/checkers/KotlinMultiFileTestWithJava.kt index e3263d5f867..b8ad5c74cf3 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/checkers/KotlinMultiFileTestWithJava.kt +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/checkers/KotlinMultiFileTestWithJava.kt @@ -53,7 +53,6 @@ abstract class KotlinMultiFileTestWithJava) { @@ -71,7 +71,7 @@ abstract class AbstractLightAnalysisModeTest : CodegenTestCase() { configurationKind = extractConfigurationKind(files) val configuration = createConfiguration( - configurationKind, getTestJdkKind(files), backend, listOf(getAnnotationsJar()), listOfNotNull(writeJavaFiles(files)), files + configurationKind, getTestJdkKind(files), listOf(getAnnotationsJar()), listOfNotNull(writeJavaFiles(files)), files ) val environment = KotlinCoreEnvironment.createForTests(testRootDisposable, configuration, EnvironmentConfigFiles.JVM_CONFIG_FILES) AnalysisHandlerExtension.registerExtension(environment.project, PartialAnalysisHandlerExtension()) diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/CodegenTestCase.java b/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/CodegenTestCase.java index 0986eb624e8..121375ff180 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/CodegenTestCase.java +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/CodegenTestCase.java @@ -89,7 +89,6 @@ public abstract class CodegenTestCase extends KotlinBaseTest(getAnnotationsJar()), listOfNotNull(writeJavaFiles(files)), files diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/jvm/compiler/AbstractCompileJavaAgainstKotlinTest.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/jvm/compiler/AbstractCompileJavaAgainstKotlinTest.kt index 6b85b22eb2f..6865be74dc3 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/jvm/compiler/AbstractCompileJavaAgainstKotlinTest.kt +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/jvm/compiler/AbstractCompileJavaAgainstKotlinTest.kt @@ -38,6 +38,7 @@ import org.jetbrains.kotlin.test.KotlinTestUtils.createEnvironmentWithMockJdkAnd import org.jetbrains.kotlin.test.KotlinTestUtils.newConfiguration import org.jetbrains.kotlin.test.TestCaseWithTmpdir import org.jetbrains.kotlin.test.TestJdkKind +import org.jetbrains.kotlin.test.testFramework.FrontendBackendConfiguration import org.jetbrains.kotlin.test.util.KtTestUtil import org.jetbrains.kotlin.test.util.RecursiveDescriptorComparatorAdaptor.validateAndCompareDescriptorWithFile import org.junit.Assert @@ -45,7 +46,7 @@ import java.io.File import java.io.IOException import java.lang.annotation.Retention -abstract class AbstractCompileJavaAgainstKotlinTest : TestCaseWithTmpdir() { +abstract class AbstractCompileJavaAgainstKotlinTest : TestCaseWithTmpdir(), FrontendBackendConfiguration { protected fun doTestWithJavac(ktFilePath: String) { doTest(ktFilePath, true) @@ -64,6 +65,9 @@ abstract class AbstractCompileJavaAgainstKotlinTest : TestCaseWithTmpdir() { val out = File(tmpdir, "out") + val directives = KotlinTestUtils.parseDirectives(ktFile.readText()) + if (useFir && directives.contains("IGNORE_FIR")) return + val compiledSuccessfully = if (useJavac) { compileKotlinWithJava( listOf(javaFile), @@ -95,7 +99,9 @@ abstract class AbstractCompileJavaAgainstKotlinTest : TestCaseWithTmpdir() { validateAndCompareDescriptorWithFile(packageView, CONFIGURATION, expectedFile) } - open fun updateConfiguration(configuration: CompilerConfiguration) {} + fun updateConfiguration(configuration: CompilerConfiguration) { + configureIrFir(configuration) + } @Throws(IOException::class) fun compileKotlinWithJava( diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/jvm/compiler/AbstractCompileKotlinAgainstJavaTest.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/jvm/compiler/AbstractCompileKotlinAgainstJavaTest.kt index 2f5a936071a..5b049973cb1 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/jvm/compiler/AbstractCompileKotlinAgainstJavaTest.kt +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/jvm/compiler/AbstractCompileKotlinAgainstJavaTest.kt @@ -37,13 +37,14 @@ import org.jetbrains.kotlin.test.KotlinTestUtils.createEnvironmentWithMockJdkAnd import org.jetbrains.kotlin.test.KotlinTestUtils.newConfiguration import org.jetbrains.kotlin.test.TestCaseWithTmpdir import org.jetbrains.kotlin.test.TestJdkKind +import org.jetbrains.kotlin.test.testFramework.FrontendBackendConfiguration import org.jetbrains.kotlin.test.util.KtTestUtil import org.jetbrains.kotlin.test.util.RecursiveDescriptorComparatorAdaptor.validateAndCompareDescriptorWithFile import org.junit.Assert import java.io.File import java.lang.annotation.Retention -abstract class AbstractCompileKotlinAgainstJavaTest : TestCaseWithTmpdir() { +abstract class AbstractCompileKotlinAgainstJavaTest : TestCaseWithTmpdir(), FrontendBackendConfiguration { protected fun doTestWithoutAPT(ktFilePath: String) { doTest(ktFilePath, aptMode = false) @@ -125,7 +126,9 @@ abstract class AbstractCompileKotlinAgainstJavaTest : TestCaseWithTmpdir() { return JavacWrapper.getInstance(environment.project).use { it.compile(outDir) } } - open fun updateConfiguration(configuration: CompilerConfiguration) {} + open fun updateConfiguration(configuration: CompilerConfiguration) { + configureIrFir(configuration) + } companion object { // Do not render parameter names because there are test cases where classes inherit from JDK collections, diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/jvm/compiler/AbstractFirCompileJavaAgainstKotlinTest.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/jvm/compiler/AbstractFirCompileJavaAgainstKotlinTest.kt deleted file mode 100644 index 199d43374d9..00000000000 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/jvm/compiler/AbstractFirCompileJavaAgainstKotlinTest.kt +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2010-2024 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.jvm.compiler - -import org.jetbrains.kotlin.config.CommonConfigurationKeys -import org.jetbrains.kotlin.config.CompilerConfiguration -import org.jetbrains.kotlin.config.JVMConfigurationKeys -import org.jetbrains.kotlin.test.KotlinTestUtils -import java.io.File - -abstract class AbstractFirCompileJavaAgainstKotlinTest(private val useLightTree: Boolean) : AbstractCompileJavaAgainstKotlinTest() { - override fun doTest(ktFilePath: String, useJavac: Boolean) { - val ktFile = File(ktFilePath) - val directives = KotlinTestUtils.parseDirectives(ktFile.readText()) - if (directives.contains("IGNORE_FIR")) return - super.doTest(ktFilePath, useJavac) - } - - override fun updateConfiguration(configuration: CompilerConfiguration) { - configuration.put(JVMConfigurationKeys.IR, true) - configuration.put(CommonConfigurationKeys.USE_FIR, true) - if (useLightTree) configuration.put(CommonConfigurationKeys.USE_LIGHT_TREE, true) - } -} diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/jvm/compiler/AbstractLoadJavaTest.java b/compiler/tests-common/tests/org/jetbrains/kotlin/jvm/compiler/AbstractLoadJavaTest.java index 50162e700ce..eb90d9e1383 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/jvm/compiler/AbstractLoadJavaTest.java +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/jvm/compiler/AbstractLoadJavaTest.java @@ -217,7 +217,7 @@ public abstract class AbstractLoadJavaTest extends TestCaseWithTmpdir { protected void configureEnvironment(KotlinCoreEnvironment environment) {} - protected void updateConfiguration(CompilerConfiguration configuration) {} + public void updateConfiguration(@NotNull CompilerConfiguration configuration) {} protected void doTestJavaAgainstKotlin(String expectedFileName) { try { diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/jvm/compiler/AbstractLoadJavaWithPsiClassReadingTest.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/jvm/compiler/AbstractLoadJavaWithPsiClassReadingTest.kt index 07bd9e3a0ae..b7339fb4ce2 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/jvm/compiler/AbstractLoadJavaWithPsiClassReadingTest.kt +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/jvm/compiler/AbstractLoadJavaWithPsiClassReadingTest.kt @@ -16,10 +16,17 @@ package org.jetbrains.kotlin.jvm.compiler +import org.jetbrains.kotlin.config.CompilerConfiguration import org.jetbrains.kotlin.test.KotlinTestUtils +import org.jetbrains.kotlin.test.testFramework.FrontendBackendConfiguration import java.io.File -abstract class AbstractLoadJavaWithPsiClassReadingTest : AbstractLoadJavaTest() { +abstract class AbstractLoadJavaWithPsiClassReadingTest : AbstractLoadJavaTest(), FrontendBackendConfiguration { + override fun updateConfiguration(configuration: CompilerConfiguration) { + configureIrFir(configuration) + super.updateConfiguration(configuration) + } + override fun usePsiClassFilesReading() = true override fun getExpectedFile(expectedFileName: String): File { diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/jvm/compiler/fir/AbstractFirLightTreeCompileJavaAgainstKotlinTest.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/jvm/compiler/fir/AbstractFirLightTreeCompileJavaAgainstKotlinTest.kt new file mode 100644 index 00000000000..2e9b48260fd --- /dev/null +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/jvm/compiler/fir/AbstractFirLightTreeCompileJavaAgainstKotlinTest.kt @@ -0,0 +1,17 @@ +/* + * Copyright 2010-2024 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.jvm.compiler.fir + +import org.jetbrains.kotlin.jvm.compiler.ir.AbstractIrCompileJavaAgainstKotlinTest +import org.jetbrains.kotlin.test.FirParser + +abstract class AbstractFirLightTreeCompileJavaAgainstKotlinTest : AbstractIrCompileJavaAgainstKotlinTest() { + override val useFir: Boolean + get() = true + + override val firParser: FirParser + get() = FirParser.LightTree +} diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/jvm/compiler/fir/AbstractFirPsiCompileJavaAgainstKotlinTest.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/jvm/compiler/fir/AbstractFirPsiCompileJavaAgainstKotlinTest.kt new file mode 100644 index 00000000000..4cb4de53166 --- /dev/null +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/jvm/compiler/fir/AbstractFirPsiCompileJavaAgainstKotlinTest.kt @@ -0,0 +1,17 @@ +/* + * Copyright 2010-2024 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.jvm.compiler.fir + +import org.jetbrains.kotlin.jvm.compiler.ir.AbstractIrCompileJavaAgainstKotlinTest +import org.jetbrains.kotlin.test.FirParser + +abstract class AbstractFirPsiCompileJavaAgainstKotlinTest : AbstractIrCompileJavaAgainstKotlinTest() { + override val useFir: Boolean + get() = true + + override val firParser: FirParser + get() = FirParser.Psi +} diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/jvm/compiler/ir/AbstractFirLightTreeCompileJavaAgainstKotlinTest.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/jvm/compiler/ir/AbstractFirLightTreeCompileJavaAgainstKotlinTest.kt deleted file mode 100644 index 87a7cea2c42..00000000000 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/jvm/compiler/ir/AbstractFirLightTreeCompileJavaAgainstKotlinTest.kt +++ /dev/null @@ -1,10 +0,0 @@ -/* - * Copyright 2010-2024 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.jvm.compiler.ir - -import org.jetbrains.kotlin.jvm.compiler.AbstractFirCompileJavaAgainstKotlinTest - -abstract class AbstractFirLightTreeCompileJavaAgainstKotlinTest : AbstractFirCompileJavaAgainstKotlinTest(true) diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/jvm/compiler/ir/AbstractFirPsiCompileJavaAgainstKotlinTest.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/jvm/compiler/ir/AbstractFirPsiCompileJavaAgainstKotlinTest.kt deleted file mode 100644 index 540cf927b30..00000000000 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/jvm/compiler/ir/AbstractFirPsiCompileJavaAgainstKotlinTest.kt +++ /dev/null @@ -1,10 +0,0 @@ -/* - * Copyright 2010-2024 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.jvm.compiler.ir - -import org.jetbrains.kotlin.jvm.compiler.AbstractFirCompileJavaAgainstKotlinTest - -abstract class AbstractFirPsiCompileJavaAgainstKotlinTest : AbstractFirCompileJavaAgainstKotlinTest(false) diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/jvm/compiler/ir/AbstractIrCompileJavaAgainstKotlinTest.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/jvm/compiler/ir/AbstractIrCompileJavaAgainstKotlinTest.kt index 052b23baf17..61f0056d7cb 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/jvm/compiler/ir/AbstractIrCompileJavaAgainstKotlinTest.kt +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/jvm/compiler/ir/AbstractIrCompileJavaAgainstKotlinTest.kt @@ -5,10 +5,10 @@ package org.jetbrains.kotlin.jvm.compiler.ir -import org.jetbrains.kotlin.config.CompilerConfiguration -import org.jetbrains.kotlin.config.JVMConfigurationKeys import org.jetbrains.kotlin.jvm.compiler.AbstractCompileJavaAgainstKotlinTest +import org.jetbrains.kotlin.test.TargetBackend abstract class AbstractIrCompileJavaAgainstKotlinTest : AbstractCompileJavaAgainstKotlinTest() { - override fun updateConfiguration(configuration: CompilerConfiguration) = configuration.put(JVMConfigurationKeys.IR, true) + override val backend: TargetBackend + get() = TargetBackend.JVM_IR } diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/jvm/compiler/ir/AbstractIrCompileKotlinAgainstJavaTest.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/jvm/compiler/ir/AbstractIrCompileKotlinAgainstJavaTest.kt index 2ce4f8e4cda..0786d2ceb08 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/jvm/compiler/ir/AbstractIrCompileKotlinAgainstJavaTest.kt +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/jvm/compiler/ir/AbstractIrCompileKotlinAgainstJavaTest.kt @@ -5,10 +5,10 @@ package org.jetbrains.kotlin.jvm.compiler.ir -import org.jetbrains.kotlin.config.CompilerConfiguration -import org.jetbrains.kotlin.config.JVMConfigurationKeys import org.jetbrains.kotlin.jvm.compiler.AbstractCompileKotlinAgainstJavaTest +import org.jetbrains.kotlin.test.TargetBackend abstract class AbstractIrCompileKotlinAgainstJavaTest : AbstractCompileKotlinAgainstJavaTest() { - override fun updateConfiguration(configuration: CompilerConfiguration) = configuration.put(JVMConfigurationKeys.IR, true) + override val backend: TargetBackend + get() = TargetBackend.JVM_IR } diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/jvm/compiler/ir/AbstractIrLoadJavaTest.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/jvm/compiler/ir/AbstractIrLoadJavaTest.kt index f5afa185bba..6b1d7bf3919 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/jvm/compiler/ir/AbstractIrLoadJavaTest.kt +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/jvm/compiler/ir/AbstractIrLoadJavaTest.kt @@ -5,10 +5,10 @@ package org.jetbrains.kotlin.jvm.compiler.ir -import org.jetbrains.kotlin.config.CompilerConfiguration -import org.jetbrains.kotlin.config.JVMConfigurationKeys import org.jetbrains.kotlin.jvm.compiler.AbstractLoadJavaWithPsiClassReadingTest +import org.jetbrains.kotlin.test.TargetBackend abstract class AbstractIrLoadJavaTest : AbstractLoadJavaWithPsiClassReadingTest() { - override fun updateConfiguration(configuration: CompilerConfiguration) = configuration.put(JVMConfigurationKeys.IR, true) + override val backend: TargetBackend + get() = TargetBackend.JVM_IR } diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/klib/AbstractKlibIrTextTestCase.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/klib/AbstractKlibIrTextTestCase.kt index 492945b71fa..c5a43c3015a 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/klib/AbstractKlibIrTextTestCase.kt +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/klib/AbstractKlibIrTextTestCase.kt @@ -76,7 +76,7 @@ abstract class AbstractKlibIrTextTestCase : CodegenTestCase() { private fun setupEnvironment(files: List) { val configuration = createConfiguration( - ConfigurationKind.ALL, TestJdkKind.MOCK_JDK, backend, + ConfigurationKind.ALL, TestJdkKind.MOCK_JDK, listOf(KtTestUtil.getAnnotationsJar()), listOfNotNull(writeJavaFiles(files)), files diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/test/KotlinBaseTest.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/test/KotlinBaseTest.kt index c37c0855b26..a8a4bd61c0e 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/test/KotlinBaseTest.kt +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/test/KotlinBaseTest.kt @@ -9,11 +9,12 @@ import org.jetbrains.kotlin.checkers.ENABLE_JVM_PREVIEW import org.jetbrains.kotlin.checkers.parseLanguageVersionSettings import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment import org.jetbrains.kotlin.config.* +import org.jetbrains.kotlin.test.testFramework.FrontendBackendConfiguration import org.jetbrains.kotlin.test.testFramework.KtUsefulTestCase import org.jetbrains.kotlin.test.util.KtTestUtil import java.io.File -abstract class KotlinBaseTest : KtUsefulTestCase() { +abstract class KotlinBaseTest : KtUsefulTestCase(), FrontendBackendConfiguration { @Throws(Exception::class) override fun setUp() { super.setUp() @@ -51,26 +52,25 @@ abstract class KotlinBaseTest : KtUsefulTestCase() return Companion.extractConfigurationKind(files) } - protected open fun updateConfiguration(configuration: CompilerConfiguration) {} + protected open fun updateConfiguration(configuration: CompilerConfiguration) { + configureIrFir(configuration) + } protected open fun setupEnvironment(environment: KotlinCoreEnvironment) {} protected open fun parseDirectivesPerFiles() = false - protected open val backend = TargetBackend.ANY protected open fun configureTestSpecific(configuration: CompilerConfiguration, testFiles: List) {} protected fun createConfiguration( kind: ConfigurationKind, jdkKind: TestJdkKind, - backend: TargetBackend, classpath: List, javaSource: List, testFilesWithConfigurationDirectives: List ): CompilerConfiguration { val configuration = KotlinTestUtils.newConfiguration(kind, jdkKind, classpath, javaSource) - configuration.put(JVMConfigurationKeys.IR, backend.isIR) updateConfigurationByDirectivesInTestFiles( testFilesWithConfigurationDirectives, configuration, diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/test/testFramework/FrontendBackendConfiguration.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/test/testFramework/FrontendBackendConfiguration.kt new file mode 100644 index 00000000000..7532ded85f1 --- /dev/null +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/test/testFramework/FrontendBackendConfiguration.kt @@ -0,0 +1,30 @@ +/* + * Copyright 2010-2024 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.test.testFramework + +import org.jetbrains.kotlin.config.CommonConfigurationKeys +import org.jetbrains.kotlin.config.CompilerConfiguration +import org.jetbrains.kotlin.config.JVMConfigurationKeys +import org.jetbrains.kotlin.test.FirParser +import org.jetbrains.kotlin.test.TargetBackend + +interface FrontendBackendConfiguration { + val useFir: Boolean + get() = false + val firParser: FirParser + get() = FirParser.Psi + val backend + get() = TargetBackend.ANY + + fun configureIrFir(configuration: CompilerConfiguration) { + configuration.put(JVMConfigurationKeys.IR, backend.isIR) + configuration.put(CommonConfigurationKeys.USE_FIR, useFir) + when (firParser) { + FirParser.LightTree -> configuration.put(CommonConfigurationKeys.USE_LIGHT_TREE, true) + FirParser.Psi -> {} + } + } +} diff --git a/compiler/tests-for-compiler-generator/tests/org/jetbrains/kotlin/test/generators/GenerateJUnit3CompilerTests.kt b/compiler/tests-for-compiler-generator/tests/org/jetbrains/kotlin/test/generators/GenerateJUnit3CompilerTests.kt index c4110c3f7f4..13ff7ff1154 100644 --- a/compiler/tests-for-compiler-generator/tests/org/jetbrains/kotlin/test/generators/GenerateJUnit3CompilerTests.kt +++ b/compiler/tests-for-compiler-generator/tests/org/jetbrains/kotlin/test/generators/GenerateJUnit3CompilerTests.kt @@ -12,8 +12,13 @@ import org.jetbrains.kotlin.cfg.AbstractPseudoValueTest import org.jetbrains.kotlin.cli.AbstractCliTest import org.jetbrains.kotlin.codegen.* import org.jetbrains.kotlin.codegen.defaultConstructor.AbstractDefaultArgumentsReflectionTest +import org.jetbrains.kotlin.codegen.defaultConstructor.fir.AbstractFirLightTreeDefaultArgumentsReflectionTest +import org.jetbrains.kotlin.codegen.defaultConstructor.fir.AbstractFirPsiDefaultArgumentsReflectionTest +import org.jetbrains.kotlin.codegen.defaultConstructor.ir.AbstractIrDefaultArgumentsReflectionTest +import org.jetbrains.kotlin.codegen.fir.* import org.jetbrains.kotlin.codegen.flags.AbstractWriteFlagsTest import org.jetbrains.kotlin.codegen.ir.* +import org.jetbrains.kotlin.codegen.ir.AbstractIrWriteSignatureTest import org.jetbrains.kotlin.fir.builder.AbstractRawFirBuilderLazyBodiesByAstTest import org.jetbrains.kotlin.fir.builder.AbstractRawFirBuilderLazyBodiesByStubTest import org.jetbrains.kotlin.fir.builder.AbstractRawFirBuilderSourceElementMappingTestCase @@ -27,6 +32,8 @@ import org.jetbrains.kotlin.generators.util.TestGeneratorUtil import org.jetbrains.kotlin.generators.util.TestGeneratorUtil.KT_OR_KTS_WITHOUT_DOTS_IN_NAME import org.jetbrains.kotlin.integration.AbstractAntTaskTest import org.jetbrains.kotlin.jvm.compiler.* +import org.jetbrains.kotlin.jvm.compiler.fir.AbstractFirLightTreeCompileJavaAgainstKotlinTest +import org.jetbrains.kotlin.jvm.compiler.fir.AbstractFirPsiCompileJavaAgainstKotlinTest import org.jetbrains.kotlin.jvm.compiler.ir.* import org.jetbrains.kotlin.jvm.compiler.javac.AbstractLoadJavaUsingJavacTest import org.jetbrains.kotlin.klib.AbstractKlibIrTextTestCase @@ -354,10 +361,46 @@ fun generateJUnit3CompilerTests(args: Array, mainClassName: String?) { model("writeFlags", targetBackend = TargetBackend.JVM_IR) } + testClass { + model("codegen/defaultArguments/reflection", targetBackend = TargetBackend.JVM_IR) + } + testClass { model("writeSignature", targetBackend = TargetBackend.JVM_IR) } + testClass { + model("checkLocalVariablesTable", targetBackend = TargetBackend.JVM_IR) + } + + testClass { + model("writeFlags", targetBackend = TargetBackend.JVM_IR) + } + + testClass { + model("codegen/defaultArguments/reflection", targetBackend = TargetBackend.JVM_IR) + } + + testClass { + model("writeSignature", targetBackend = TargetBackend.JVM_IR) + } + + testClass { + model("writeFlags", targetBackend = TargetBackend.JVM_IR) + } + + testClass { + model("codegen/defaultArguments/reflection", targetBackend = TargetBackend.JVM_IR) + } + + testClass { + model("checkLocalVariablesTable", targetBackend = TargetBackend.JVM_IR) + } + + testClass { + model("writeSignature", targetBackend = TargetBackend.JVM_IR) + } + testClass { model("loadJava/compiledJava", extension = "java", testMethod = "doTestCompiledJava", targetBackend = TargetBackend.JVM_IR) model( diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/defaultConstructor/fir/FirLightTreeDefaultArgumentsReflectionTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/defaultConstructor/fir/FirLightTreeDefaultArgumentsReflectionTestGenerated.java new file mode 100644 index 00000000000..796c4bd3913 --- /dev/null +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/defaultConstructor/fir/FirLightTreeDefaultArgumentsReflectionTestGenerated.java @@ -0,0 +1,92 @@ +/* + * Copyright 2010-2024 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.codegen.defaultConstructor.fir; + +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 java.io.File; +import java.util.regex.Pattern; + +/** This class is generated by {@link org.jetbrains.kotlin.test.generators.GenerateCompilerTestsKt}. DO NOT MODIFY MANUALLY */ +@SuppressWarnings("all") +@TestMetadata("compiler/testData/codegen/defaultArguments/reflection") +@TestDataPath("$PROJECT_ROOT") +@RunWith(JUnit3RunnerWithInners.class) +public class FirLightTreeDefaultArgumentsReflectionTestGenerated extends AbstractFirLightTreeDefaultArgumentsReflectionTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInReflection() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/defaultArguments/reflection"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("classInClassObject.kt") + public void testClassInClassObject() { + runTest("compiler/testData/codegen/defaultArguments/reflection/classInClassObject.kt"); + } + + @TestMetadata("classInObject.kt") + public void testClassInObject() { + runTest("compiler/testData/codegen/defaultArguments/reflection/classInObject.kt"); + } + + @TestMetadata("classWithTwoDefaultArgs.kt") + public void testClassWithTwoDefaultArgs() { + runTest("compiler/testData/codegen/defaultArguments/reflection/classWithTwoDefaultArgs.kt"); + } + + @TestMetadata("classWithVararg.kt") + public void testClassWithVararg() { + runTest("compiler/testData/codegen/defaultArguments/reflection/classWithVararg.kt"); + } + + @TestMetadata("enum.kt") + public void testEnum() { + runTest("compiler/testData/codegen/defaultArguments/reflection/enum.kt"); + } + + @TestMetadata("internalClass.kt") + public void testInternalClass() { + runTest("compiler/testData/codegen/defaultArguments/reflection/internalClass.kt"); + } + + @TestMetadata("privateClass.kt") + public void testPrivateClass() { + runTest("compiler/testData/codegen/defaultArguments/reflection/privateClass.kt"); + } + + @TestMetadata("privateConstructor.kt") + public void testPrivateConstructor() { + runTest("compiler/testData/codegen/defaultArguments/reflection/privateConstructor.kt"); + } + + @TestMetadata("publicClass.kt") + public void testPublicClass() { + runTest("compiler/testData/codegen/defaultArguments/reflection/publicClass.kt"); + } + + @TestMetadata("publicClassWoDefArgs.kt") + public void testPublicClassWoDefArgs() { + runTest("compiler/testData/codegen/defaultArguments/reflection/publicClassWoDefArgs.kt"); + } + + @TestMetadata("publicInnerClass.kt") + public void testPublicInnerClass() { + runTest("compiler/testData/codegen/defaultArguments/reflection/publicInnerClass.kt"); + } + + @TestMetadata("publicInnerClassInPrivateClass.kt") + public void testPublicInnerClassInPrivateClass() { + runTest("compiler/testData/codegen/defaultArguments/reflection/publicInnerClassInPrivateClass.kt"); + } +} diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/defaultConstructor/fir/FirPsiDefaultArgumentsReflectionTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/defaultConstructor/fir/FirPsiDefaultArgumentsReflectionTestGenerated.java new file mode 100644 index 00000000000..e05c5c237a8 --- /dev/null +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/defaultConstructor/fir/FirPsiDefaultArgumentsReflectionTestGenerated.java @@ -0,0 +1,92 @@ +/* + * Copyright 2010-2024 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.codegen.defaultConstructor.fir; + +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 java.io.File; +import java.util.regex.Pattern; + +/** This class is generated by {@link org.jetbrains.kotlin.test.generators.GenerateCompilerTestsKt}. DO NOT MODIFY MANUALLY */ +@SuppressWarnings("all") +@TestMetadata("compiler/testData/codegen/defaultArguments/reflection") +@TestDataPath("$PROJECT_ROOT") +@RunWith(JUnit3RunnerWithInners.class) +public class FirPsiDefaultArgumentsReflectionTestGenerated extends AbstractFirPsiDefaultArgumentsReflectionTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInReflection() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/defaultArguments/reflection"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("classInClassObject.kt") + public void testClassInClassObject() { + runTest("compiler/testData/codegen/defaultArguments/reflection/classInClassObject.kt"); + } + + @TestMetadata("classInObject.kt") + public void testClassInObject() { + runTest("compiler/testData/codegen/defaultArguments/reflection/classInObject.kt"); + } + + @TestMetadata("classWithTwoDefaultArgs.kt") + public void testClassWithTwoDefaultArgs() { + runTest("compiler/testData/codegen/defaultArguments/reflection/classWithTwoDefaultArgs.kt"); + } + + @TestMetadata("classWithVararg.kt") + public void testClassWithVararg() { + runTest("compiler/testData/codegen/defaultArguments/reflection/classWithVararg.kt"); + } + + @TestMetadata("enum.kt") + public void testEnum() { + runTest("compiler/testData/codegen/defaultArguments/reflection/enum.kt"); + } + + @TestMetadata("internalClass.kt") + public void testInternalClass() { + runTest("compiler/testData/codegen/defaultArguments/reflection/internalClass.kt"); + } + + @TestMetadata("privateClass.kt") + public void testPrivateClass() { + runTest("compiler/testData/codegen/defaultArguments/reflection/privateClass.kt"); + } + + @TestMetadata("privateConstructor.kt") + public void testPrivateConstructor() { + runTest("compiler/testData/codegen/defaultArguments/reflection/privateConstructor.kt"); + } + + @TestMetadata("publicClass.kt") + public void testPublicClass() { + runTest("compiler/testData/codegen/defaultArguments/reflection/publicClass.kt"); + } + + @TestMetadata("publicClassWoDefArgs.kt") + public void testPublicClassWoDefArgs() { + runTest("compiler/testData/codegen/defaultArguments/reflection/publicClassWoDefArgs.kt"); + } + + @TestMetadata("publicInnerClass.kt") + public void testPublicInnerClass() { + runTest("compiler/testData/codegen/defaultArguments/reflection/publicInnerClass.kt"); + } + + @TestMetadata("publicInnerClassInPrivateClass.kt") + public void testPublicInnerClassInPrivateClass() { + runTest("compiler/testData/codegen/defaultArguments/reflection/publicInnerClassInPrivateClass.kt"); + } +} diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/defaultConstructor/ir/IrDefaultArgumentsReflectionTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/defaultConstructor/ir/IrDefaultArgumentsReflectionTestGenerated.java new file mode 100644 index 00000000000..31564adfcbb --- /dev/null +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/defaultConstructor/ir/IrDefaultArgumentsReflectionTestGenerated.java @@ -0,0 +1,92 @@ +/* + * Copyright 2010-2024 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.codegen.defaultConstructor.ir; + +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 java.io.File; +import java.util.regex.Pattern; + +/** This class is generated by {@link org.jetbrains.kotlin.test.generators.GenerateCompilerTestsKt}. DO NOT MODIFY MANUALLY */ +@SuppressWarnings("all") +@TestMetadata("compiler/testData/codegen/defaultArguments/reflection") +@TestDataPath("$PROJECT_ROOT") +@RunWith(JUnit3RunnerWithInners.class) +public class IrDefaultArgumentsReflectionTestGenerated extends AbstractIrDefaultArgumentsReflectionTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInReflection() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/defaultArguments/reflection"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("classInClassObject.kt") + public void testClassInClassObject() { + runTest("compiler/testData/codegen/defaultArguments/reflection/classInClassObject.kt"); + } + + @TestMetadata("classInObject.kt") + public void testClassInObject() { + runTest("compiler/testData/codegen/defaultArguments/reflection/classInObject.kt"); + } + + @TestMetadata("classWithTwoDefaultArgs.kt") + public void testClassWithTwoDefaultArgs() { + runTest("compiler/testData/codegen/defaultArguments/reflection/classWithTwoDefaultArgs.kt"); + } + + @TestMetadata("classWithVararg.kt") + public void testClassWithVararg() { + runTest("compiler/testData/codegen/defaultArguments/reflection/classWithVararg.kt"); + } + + @TestMetadata("enum.kt") + public void testEnum() { + runTest("compiler/testData/codegen/defaultArguments/reflection/enum.kt"); + } + + @TestMetadata("internalClass.kt") + public void testInternalClass() { + runTest("compiler/testData/codegen/defaultArguments/reflection/internalClass.kt"); + } + + @TestMetadata("privateClass.kt") + public void testPrivateClass() { + runTest("compiler/testData/codegen/defaultArguments/reflection/privateClass.kt"); + } + + @TestMetadata("privateConstructor.kt") + public void testPrivateConstructor() { + runTest("compiler/testData/codegen/defaultArguments/reflection/privateConstructor.kt"); + } + + @TestMetadata("publicClass.kt") + public void testPublicClass() { + runTest("compiler/testData/codegen/defaultArguments/reflection/publicClass.kt"); + } + + @TestMetadata("publicClassWoDefArgs.kt") + public void testPublicClassWoDefArgs() { + runTest("compiler/testData/codegen/defaultArguments/reflection/publicClassWoDefArgs.kt"); + } + + @TestMetadata("publicInnerClass.kt") + public void testPublicInnerClass() { + runTest("compiler/testData/codegen/defaultArguments/reflection/publicInnerClass.kt"); + } + + @TestMetadata("publicInnerClassInPrivateClass.kt") + public void testPublicInnerClassInPrivateClass() { + runTest("compiler/testData/codegen/defaultArguments/reflection/publicInnerClassInPrivateClass.kt"); + } +} diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/fir/FirLightTreeCheckLocalVariablesTableTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/fir/FirLightTreeCheckLocalVariablesTableTestGenerated.java new file mode 100644 index 00000000000..499af311b6c --- /dev/null +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/fir/FirLightTreeCheckLocalVariablesTableTestGenerated.java @@ -0,0 +1,135 @@ +/* + * Copyright 2010-2024 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.codegen.fir; + +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 java.io.File; +import java.util.regex.Pattern; + +/** This class is generated by {@link org.jetbrains.kotlin.test.generators.GenerateCompilerTestsKt}. DO NOT MODIFY MANUALLY */ +@SuppressWarnings("all") +@TestMetadata("compiler/testData/checkLocalVariablesTable") +@TestDataPath("$PROJECT_ROOT") +@RunWith(JUnit3RunnerWithInners.class) +public class FirLightTreeCheckLocalVariablesTableTestGenerated extends AbstractFirLightTreeCheckLocalVariablesTableTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInCheckLocalVariablesTable() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/checkLocalVariablesTable"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("destructuringInLambdas.kt") + public void testDestructuringInLambdas() { + runTest("compiler/testData/checkLocalVariablesTable/destructuringInLambdas.kt"); + } + + @TestMetadata("inlineLambdaWithItParam.kt") + public void testInlineLambdaWithItParam() { + runTest("compiler/testData/checkLocalVariablesTable/inlineLambdaWithItParam.kt"); + } + + @TestMetadata("inlineLambdaWithParam.kt") + public void testInlineLambdaWithParam() { + runTest("compiler/testData/checkLocalVariablesTable/inlineLambdaWithParam.kt"); + } + + @TestMetadata("inlineSimple.kt") + public void testInlineSimple() { + runTest("compiler/testData/checkLocalVariablesTable/inlineSimple.kt"); + } + + @TestMetadata("inlineSimpleChain.kt") + public void testInlineSimpleChain() { + runTest("compiler/testData/checkLocalVariablesTable/inlineSimpleChain.kt"); + } + + @TestMetadata("itInLambda.kt") + public void testItInLambda() { + runTest("compiler/testData/checkLocalVariablesTable/itInLambda.kt"); + } + + @TestMetadata("itInReturnedLambda.kt") + public void testItInReturnedLambda() { + runTest("compiler/testData/checkLocalVariablesTable/itInReturnedLambda.kt"); + } + + @TestMetadata("kt11117.kt") + public void testKt11117() { + runTest("compiler/testData/checkLocalVariablesTable/kt11117.kt"); + } + + @TestMetadata("lambdaAsVar.kt") + public void testLambdaAsVar() { + runTest("compiler/testData/checkLocalVariablesTable/lambdaAsVar.kt"); + } + + @TestMetadata("objectInLocalPropertyDelegate.kt") + public void testObjectInLocalPropertyDelegate() { + runTest("compiler/testData/checkLocalVariablesTable/objectInLocalPropertyDelegate.kt"); + } + + @TestMetadata("suspendFunctionDeadVariables.kt") + public void testSuspendFunctionDeadVariables() { + runTest("compiler/testData/checkLocalVariablesTable/suspendFunctionDeadVariables.kt"); + } + + @TestMetadata("underscoreNames.kt") + public void testUnderscoreNames() { + runTest("compiler/testData/checkLocalVariablesTable/underscoreNames.kt"); + } + + @TestMetadata("compiler/testData/checkLocalVariablesTable/parametersInSuspendLambda") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class ParametersInSuspendLambda extends AbstractFirLightTreeCheckLocalVariablesTableTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInParametersInSuspendLambda() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/checkLocalVariablesTable/parametersInSuspendLambda"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("dataClass.kt") + public void testDataClass() { + runTest("compiler/testData/checkLocalVariablesTable/parametersInSuspendLambda/dataClass.kt"); + } + + @TestMetadata("extensionComponents.kt") + public void testExtensionComponents() { + runTest("compiler/testData/checkLocalVariablesTable/parametersInSuspendLambda/extensionComponents.kt"); + } + + @TestMetadata("generic.kt") + public void testGeneric() { + runTest("compiler/testData/checkLocalVariablesTable/parametersInSuspendLambda/generic.kt"); + } + + @TestMetadata("inline.kt") + public void testInline() { + runTest("compiler/testData/checkLocalVariablesTable/parametersInSuspendLambda/inline.kt"); + } + + @TestMetadata("otherParameters.kt") + public void testOtherParameters() { + runTest("compiler/testData/checkLocalVariablesTable/parametersInSuspendLambda/otherParameters.kt"); + } + + @TestMetadata("parameters.kt") + public void testParameters() { + runTest("compiler/testData/checkLocalVariablesTable/parametersInSuspendLambda/parameters.kt"); + } + } +} diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/fir/FirLightTreeWriteFlagsTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/fir/FirLightTreeWriteFlagsTestGenerated.java new file mode 100644 index 00000000000..ee886e1fb93 --- /dev/null +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/fir/FirLightTreeWriteFlagsTestGenerated.java @@ -0,0 +1,1288 @@ +/* + * Copyright 2010-2024 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.codegen.fir; + +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 java.io.File; +import java.util.regex.Pattern; + +/** This class is generated by {@link org.jetbrains.kotlin.test.generators.GenerateCompilerTestsKt}. DO NOT MODIFY MANUALLY */ +@SuppressWarnings("all") +@TestMetadata("compiler/testData/writeFlags") +@TestDataPath("$PROJECT_ROOT") +@RunWith(JUnit3RunnerWithInners.class) +public class FirLightTreeWriteFlagsTestGenerated extends AbstractFirLightTreeWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInWriteFlags() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("protectedAccessToBaseMethod.kt") + public void testProtectedAccessToBaseMethod() { + runTest("compiler/testData/writeFlags/protectedAccessToBaseMethod.kt"); + } + + @TestMetadata("protectedAccessToBaseMethodDifferentPackage.kt") + public void testProtectedAccessToBaseMethodDifferentPackage() { + runTest("compiler/testData/writeFlags/protectedAccessToBaseMethodDifferentPackage.kt"); + } + + @TestMetadata("compiler/testData/writeFlags/callableReference") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class CallableReference extends AbstractFirLightTreeWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInCallableReference() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/callableReference"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("compiler/testData/writeFlags/callableReference/flags") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Flags extends AbstractFirLightTreeWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInFlags() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/callableReference/flags"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("functionReference.kt") + public void testFunctionReference() { + runTest("compiler/testData/writeFlags/callableReference/flags/functionReference.kt"); + } + + @TestMetadata("functionReferenceInInlineFunction.kt") + public void testFunctionReferenceInInlineFunction() { + runTest("compiler/testData/writeFlags/callableReference/flags/functionReferenceInInlineFunction.kt"); + } + + @TestMetadata("propertyReference.kt") + public void testPropertyReference() { + runTest("compiler/testData/writeFlags/callableReference/flags/propertyReference.kt"); + } + + @TestMetadata("propertyReferenceInInlineFunction.kt") + public void testPropertyReferenceInInlineFunction() { + runTest("compiler/testData/writeFlags/callableReference/flags/propertyReferenceInInlineFunction.kt"); + } + } + } + + @TestMetadata("compiler/testData/writeFlags/class") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Class extends AbstractFirLightTreeWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInClass() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/class"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("compiler/testData/writeFlags/class/accessFlags") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class AccessFlags extends AbstractFirLightTreeWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInAccessFlags() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/class/accessFlags"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("defaultImpls.kt") + public void testDefaultImpls() { + runTest("compiler/testData/writeFlags/class/accessFlags/defaultImpls.kt"); + } + + @TestMetadata("innerSealed.kt") + public void testInnerSealed() { + runTest("compiler/testData/writeFlags/class/accessFlags/innerSealed.kt"); + } + + @TestMetadata("mappingWhen.kt") + public void testMappingWhen() { + runTest("compiler/testData/writeFlags/class/accessFlags/mappingWhen.kt"); + } + + @TestMetadata("objectLiteral.kt") + public void testObjectLiteral() { + runTest("compiler/testData/writeFlags/class/accessFlags/objectLiteral.kt"); + } + + @TestMetadata("publicFinalClass.kt") + public void testPublicFinalClass() { + runTest("compiler/testData/writeFlags/class/accessFlags/publicFinalClass.kt"); + } + + @TestMetadata("publicFinalInnerClass.kt") + public void testPublicFinalInnerClass() { + runTest("compiler/testData/writeFlags/class/accessFlags/publicFinalInnerClass.kt"); + } + + @TestMetadata("publicInnerInterface.kt") + public void testPublicInnerInterface() { + runTest("compiler/testData/writeFlags/class/accessFlags/publicInnerInterface.kt"); + } + + @TestMetadata("publicInterface.kt") + public void testPublicInterface() { + runTest("compiler/testData/writeFlags/class/accessFlags/publicInterface.kt"); + } + + @TestMetadata("simpleFilePackageFacade.kt") + public void testSimpleFilePackageFacade() { + runTest("compiler/testData/writeFlags/class/accessFlags/simpleFilePackageFacade.kt"); + } + + @TestMetadata("syntheticFile.kt") + public void testSyntheticFile() { + runTest("compiler/testData/writeFlags/class/accessFlags/syntheticFile.kt"); + } + } + + @TestMetadata("compiler/testData/writeFlags/class/deprecatedFlag") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class DeprecatedFlag extends AbstractFirLightTreeWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInDeprecatedFlag() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/class/deprecatedFlag"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("class.kt") + public void testClass() { + runTest("compiler/testData/writeFlags/class/deprecatedFlag/class.kt"); + } + + @TestMetadata("classObject.kt") + public void testClassObject() { + runTest("compiler/testData/writeFlags/class/deprecatedFlag/classObject.kt"); + } + + @TestMetadata("enumClass.kt") + public void testEnumClass() { + runTest("compiler/testData/writeFlags/class/deprecatedFlag/enumClass.kt"); + } + + @TestMetadata("innerClass.kt") + public void testInnerClass() { + runTest("compiler/testData/writeFlags/class/deprecatedFlag/innerClass.kt"); + } + + @TestMetadata("trait.kt") + public void testTrait() { + runTest("compiler/testData/writeFlags/class/deprecatedFlag/trait.kt"); + } + } + + @TestMetadata("compiler/testData/writeFlags/class/visibility") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Visibility extends AbstractFirLightTreeWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInVisibility() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/class/visibility"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("compiler/testData/writeFlags/class/visibility/internal") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Internal extends AbstractFirLightTreeWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInInternal() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/class/visibility/internal"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("class.kt") + public void testClass() { + runTest("compiler/testData/writeFlags/class/visibility/internal/class.kt"); + } + + @TestMetadata("enum.kt") + public void testEnum() { + runTest("compiler/testData/writeFlags/class/visibility/internal/enum.kt"); + } + + @TestMetadata("innerClass.kt") + public void testInnerClass() { + runTest("compiler/testData/writeFlags/class/visibility/internal/innerClass.kt"); + } + + @TestMetadata("innerEnum.kt") + public void testInnerEnum() { + runTest("compiler/testData/writeFlags/class/visibility/internal/innerEnum.kt"); + } + + @TestMetadata("innerObject.kt") + public void testInnerObject() { + runTest("compiler/testData/writeFlags/class/visibility/internal/innerObject.kt"); + } + + @TestMetadata("innerTrait.kt") + public void testInnerTrait() { + runTest("compiler/testData/writeFlags/class/visibility/internal/innerTrait.kt"); + } + + @TestMetadata("object.kt") + public void testObject() { + runTest("compiler/testData/writeFlags/class/visibility/internal/object.kt"); + } + + @TestMetadata("trait.kt") + public void testTrait() { + runTest("compiler/testData/writeFlags/class/visibility/internal/trait.kt"); + } + } + + @TestMetadata("compiler/testData/writeFlags/class/visibility/packageprivate") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Packageprivate extends AbstractFirLightTreeWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInPackageprivate() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/class/visibility/packageprivate"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("enumEntry.kt") + public void testEnumEntry() { + runTest("compiler/testData/writeFlags/class/visibility/packageprivate/enumEntry.kt"); + } + } + + @TestMetadata("compiler/testData/writeFlags/class/visibility/private") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Private extends AbstractFirLightTreeWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInPrivate() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/class/visibility/private"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("class.kt") + public void testClass() { + runTest("compiler/testData/writeFlags/class/visibility/private/class.kt"); + } + + @TestMetadata("enum.kt") + public void testEnum() { + runTest("compiler/testData/writeFlags/class/visibility/private/enum.kt"); + } + + @TestMetadata("innerClass.kt") + public void testInnerClass() { + runTest("compiler/testData/writeFlags/class/visibility/private/innerClass.kt"); + } + + @TestMetadata("innerEnum.kt") + public void testInnerEnum() { + runTest("compiler/testData/writeFlags/class/visibility/private/innerEnum.kt"); + } + + @TestMetadata("innerObject.kt") + public void testInnerObject() { + runTest("compiler/testData/writeFlags/class/visibility/private/innerObject.kt"); + } + + @TestMetadata("innerTrait.kt") + public void testInnerTrait() { + runTest("compiler/testData/writeFlags/class/visibility/private/innerTrait.kt"); + } + + @TestMetadata("object.kt") + public void testObject() { + runTest("compiler/testData/writeFlags/class/visibility/private/object.kt"); + } + + @TestMetadata("trait.kt") + public void testTrait() { + runTest("compiler/testData/writeFlags/class/visibility/private/trait.kt"); + } + } + + @TestMetadata("compiler/testData/writeFlags/class/visibility/public") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Public extends AbstractFirLightTreeWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInPublic() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/class/visibility/public"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("class.kt") + public void testClass() { + runTest("compiler/testData/writeFlags/class/visibility/public/class.kt"); + } + + @TestMetadata("enum.kt") + public void testEnum() { + runTest("compiler/testData/writeFlags/class/visibility/public/enum.kt"); + } + + @TestMetadata("innerClass.kt") + public void testInnerClass() { + runTest("compiler/testData/writeFlags/class/visibility/public/innerClass.kt"); + } + + @TestMetadata("innerEnum.kt") + public void testInnerEnum() { + runTest("compiler/testData/writeFlags/class/visibility/public/innerEnum.kt"); + } + + @TestMetadata("innerObject.kt") + public void testInnerObject() { + runTest("compiler/testData/writeFlags/class/visibility/public/innerObject.kt"); + } + + @TestMetadata("innerTrait.kt") + public void testInnerTrait() { + runTest("compiler/testData/writeFlags/class/visibility/public/innerTrait.kt"); + } + + @TestMetadata("object.kt") + public void testObject() { + runTest("compiler/testData/writeFlags/class/visibility/public/object.kt"); + } + + @TestMetadata("trait.kt") + public void testTrait() { + runTest("compiler/testData/writeFlags/class/visibility/public/trait.kt"); + } + } + } + } + + @TestMetadata("compiler/testData/writeFlags/delegatedProperty") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class DelegatedProperty extends AbstractFirLightTreeWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInDelegatedProperty() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/delegatedProperty"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("compiler/testData/writeFlags/delegatedProperty/visibility") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Visibility extends AbstractFirLightTreeWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInVisibility() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/delegatedProperty/visibility"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("privateSet.kt") + public void testPrivateSet() { + runTest("compiler/testData/writeFlags/delegatedProperty/visibility/privateSet.kt"); + } + } + } + + @TestMetadata("compiler/testData/writeFlags/function") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Function extends AbstractFirLightTreeWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInFunction() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/function"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("compiler/testData/writeFlags/function/classObjectPrivate") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class ClassObjectPrivate extends AbstractFirLightTreeWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInClassObjectPrivate() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/function/classObjectPrivate"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("privateFun.kt") + public void testPrivateFun() { + runTest("compiler/testData/writeFlags/function/classObjectPrivate/privateFun.kt"); + } + + @TestMetadata("privateVal.kt") + public void testPrivateVal() { + runTest("compiler/testData/writeFlags/function/classObjectPrivate/privateVal.kt"); + } + + @TestMetadata("privateVar.kt") + public void testPrivateVar() { + runTest("compiler/testData/writeFlags/function/classObjectPrivate/privateVar.kt"); + } + } + + @TestMetadata("compiler/testData/writeFlags/function/constructors") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Constructors extends AbstractFirLightTreeWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInConstructors() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/function/constructors"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("classObject.kt") + public void testClassObject() { + runTest("compiler/testData/writeFlags/function/constructors/classObject.kt"); + } + + @TestMetadata("enum.kt") + public void testEnum() { + runTest("compiler/testData/writeFlags/function/constructors/enum.kt"); + } + + @TestMetadata("localClass.kt") + public void testLocalClass() { + runTest("compiler/testData/writeFlags/function/constructors/localClass.kt"); + } + + @TestMetadata("objectInClass.kt") + public void testObjectInClass() { + runTest("compiler/testData/writeFlags/function/constructors/objectInClass.kt"); + } + + @TestMetadata("objectLiteral.kt") + public void testObjectLiteral() { + runTest("compiler/testData/writeFlags/function/constructors/objectLiteral.kt"); + } + + @TestMetadata("topLevelObject.kt") + public void testTopLevelObject() { + runTest("compiler/testData/writeFlags/function/constructors/topLevelObject.kt"); + } + + @TestMetadata("withMangledArguments.kt") + public void testWithMangledArguments() { + runTest("compiler/testData/writeFlags/function/constructors/withMangledArguments.kt"); + } + } + + @TestMetadata("compiler/testData/writeFlags/function/deprecatedFlag") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class DeprecatedFlag extends AbstractFirLightTreeWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInDeprecatedFlag() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/function/deprecatedFlag"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("deprecatedSinceKotlin.kt") + public void testDeprecatedSinceKotlin() { + runTest("compiler/testData/writeFlags/function/deprecatedFlag/deprecatedSinceKotlin.kt"); + } + + @TestMetadata("emptyGetter.kt") + public void testEmptyGetter() { + runTest("compiler/testData/writeFlags/function/deprecatedFlag/emptyGetter.kt"); + } + + @TestMetadata("emptySetter.kt") + public void testEmptySetter() { + runTest("compiler/testData/writeFlags/function/deprecatedFlag/emptySetter.kt"); + } + + @TestMetadata("extentionFun.kt") + public void testExtentionFun() { + runTest("compiler/testData/writeFlags/function/deprecatedFlag/extentionFun.kt"); + } + + @TestMetadata("funInClass.kt") + public void testFunInClass() { + runTest("compiler/testData/writeFlags/function/deprecatedFlag/funInClass.kt"); + } + + @TestMetadata("funInClassObject.kt") + public void testFunInClassObject() { + runTest("compiler/testData/writeFlags/function/deprecatedFlag/funInClassObject.kt"); + } + + @TestMetadata("getter.kt") + public void testGetter() { + runTest("compiler/testData/writeFlags/function/deprecatedFlag/getter.kt"); + } + + @TestMetadata("getterAnnotationOnProperty.kt") + public void testGetterAnnotationOnProperty() { + runTest("compiler/testData/writeFlags/function/deprecatedFlag/getterAnnotationOnProperty.kt"); + } + + @TestMetadata("getterForPropertyInConstructor.kt") + public void testGetterForPropertyInConstructor() { + runTest("compiler/testData/writeFlags/function/deprecatedFlag/getterForPropertyInConstructor.kt"); + } + + @TestMetadata("setter.kt") + public void testSetter() { + runTest("compiler/testData/writeFlags/function/deprecatedFlag/setter.kt"); + } + + @TestMetadata("setterAnnotationOnProperty.kt") + public void testSetterAnnotationOnProperty() { + runTest("compiler/testData/writeFlags/function/deprecatedFlag/setterAnnotationOnProperty.kt"); + } + + @TestMetadata("setterForPropertyInConstructor.kt") + public void testSetterForPropertyInConstructor() { + runTest("compiler/testData/writeFlags/function/deprecatedFlag/setterForPropertyInConstructor.kt"); + } + + @TestMetadata("topLevelFun.kt") + public void testTopLevelFun() { + runTest("compiler/testData/writeFlags/function/deprecatedFlag/topLevelFun.kt"); + } + } + + @TestMetadata("compiler/testData/writeFlags/function/withDefaultArguments") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class WithDefaultArguments extends AbstractFirLightTreeWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInWithDefaultArguments() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/function/withDefaultArguments"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("funInClass.kt") + public void testFunInClass() { + runTest("compiler/testData/writeFlags/function/withDefaultArguments/funInClass.kt"); + } + + @TestMetadata("funInClassObject.kt") + public void testFunInClassObject() { + runTest("compiler/testData/writeFlags/function/withDefaultArguments/funInClassObject.kt"); + } + + @TestMetadata("inlineOnlyFunInClass.kt") + public void testInlineOnlyFunInClass() { + runTest("compiler/testData/writeFlags/function/withDefaultArguments/inlineOnlyFunInClass.kt"); + } + + @TestMetadata("reifiedFunInClass.kt") + public void testReifiedFunInClass() { + runTest("compiler/testData/writeFlags/function/withDefaultArguments/reifiedFunInClass.kt"); + } + + @TestMetadata("topLevelFun.kt") + public void testTopLevelFun() { + runTest("compiler/testData/writeFlags/function/withDefaultArguments/topLevelFun.kt"); + } + } + } + + @TestMetadata("compiler/testData/writeFlags/hidden") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Hidden extends AbstractFirLightTreeWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInHidden() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/hidden"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("function.kt") + public void testFunction() { + runTest("compiler/testData/writeFlags/hidden/function.kt"); + } + + @TestMetadata("propertyGetter.kt") + public void testPropertyGetter() { + runTest("compiler/testData/writeFlags/hidden/propertyGetter.kt"); + } + + @TestMetadata("propertySetter.kt") + public void testPropertySetter() { + runTest("compiler/testData/writeFlags/hidden/propertySetter.kt"); + } + } + + @TestMetadata("compiler/testData/writeFlags/inline") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Inline extends AbstractFirLightTreeWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInInline() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/inline"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("inlineOnly.kt") + public void testInlineOnly() { + runTest("compiler/testData/writeFlags/inline/inlineOnly.kt"); + } + + @TestMetadata("lostInnerClass.kt") + public void testLostInnerClass() { + runTest("compiler/testData/writeFlags/inline/lostInnerClass.kt"); + } + + @TestMetadata("lostInnerClass2.kt") + public void testLostInnerClass2() { + runTest("compiler/testData/writeFlags/inline/lostInnerClass2.kt"); + } + + @TestMetadata("lostInnerClass3.kt") + public void testLostInnerClass3() { + runTest("compiler/testData/writeFlags/inline/lostInnerClass3.kt"); + } + } + + @TestMetadata("compiler/testData/writeFlags/innerClass") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class InnerClass extends AbstractFirLightTreeWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInInnerClass() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/innerClass"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("compiler/testData/writeFlags/innerClass/visibility") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Visibility extends AbstractFirLightTreeWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInVisibility() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/innerClass/visibility"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("internal.kt") + public void testInternal() { + runTest("compiler/testData/writeFlags/innerClass/visibility/internal.kt"); + } + + @TestMetadata("internalClassObject.kt") + public void testInternalClassObject() { + runTest("compiler/testData/writeFlags/innerClass/visibility/internalClassObject.kt"); + } + + @TestMetadata("private.kt") + public void testPrivate() { + runTest("compiler/testData/writeFlags/innerClass/visibility/private.kt"); + } + + @TestMetadata("privateClassObject.kt") + public void testPrivateClassObject() { + runTest("compiler/testData/writeFlags/innerClass/visibility/privateClassObject.kt"); + } + + @TestMetadata("public.kt") + public void testPublic() { + runTest("compiler/testData/writeFlags/innerClass/visibility/public.kt"); + } + + @TestMetadata("publicClassObject.kt") + public void testPublicClassObject() { + runTest("compiler/testData/writeFlags/innerClass/visibility/publicClassObject.kt"); + } + } + } + + @TestMetadata("compiler/testData/writeFlags/jvm8") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Jvm8 extends AbstractFirLightTreeWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInJvm8() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/jvm8"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("interfaceMethod.kt") + public void testInterfaceMethod() { + runTest("compiler/testData/writeFlags/jvm8/interfaceMethod.kt"); + } + + @TestMetadata("interfaceProperty.kt") + public void testInterfaceProperty() { + runTest("compiler/testData/writeFlags/jvm8/interfaceProperty.kt"); + } + + @TestMetadata("compiler/testData/writeFlags/jvm8/defaults") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Defaults extends AbstractFirLightTreeWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInDefaults() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/jvm8/defaults"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("compiler/testData/writeFlags/jvm8/defaults/all-compatibility") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class All_compatibility extends AbstractFirLightTreeWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInAll_compatibility() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/jvm8/defaults/all-compatibility"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("defaultImplementations.kt") + public void testDefaultImplementations() { + runTest("compiler/testData/writeFlags/jvm8/defaults/all-compatibility/defaultImplementations.kt"); + } + + @TestMetadata("propertyAccessors.kt") + public void testPropertyAccessors() { + runTest("compiler/testData/writeFlags/jvm8/defaults/all-compatibility/propertyAccessors.kt"); + } + + @TestMetadata("propertyAnnotation.kt") + public void testPropertyAnnotation() { + runTest("compiler/testData/writeFlags/jvm8/defaults/all-compatibility/propertyAnnotation.kt"); + } + } + } + } + + @TestMetadata("compiler/testData/writeFlags/jvmOverloads") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class JvmOverloads extends AbstractFirLightTreeWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInJvmOverloads() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/jvmOverloads"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("openFunction.kt") + public void testOpenFunction() { + runTest("compiler/testData/writeFlags/jvmOverloads/openFunction.kt"); + } + + @TestMetadata("openFunction_1_3.kt") + public void testOpenFunction_1_3() { + runTest("compiler/testData/writeFlags/jvmOverloads/openFunction_1_3.kt"); + } + } + + @TestMetadata("compiler/testData/writeFlags/lambda") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Lambda extends AbstractFirLightTreeWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInLambda() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/lambda"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("lambdaInInlineFunction.kt") + public void testLambdaInInlineFunction() { + runTest("compiler/testData/writeFlags/lambda/lambdaInInlineFunction.kt"); + } + + @TestMetadata("simpleLambda.kt") + public void testSimpleLambda() { + runTest("compiler/testData/writeFlags/lambda/simpleLambda.kt"); + } + } + + @TestMetadata("compiler/testData/writeFlags/lateinit") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Lateinit extends AbstractFirLightTreeWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInLateinit() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/lateinit"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("lateinitGetter.kt") + public void testLateinitGetter() { + runTest("compiler/testData/writeFlags/lateinit/lateinitGetter.kt"); + } + + @TestMetadata("lateinitProperty.kt") + public void testLateinitProperty() { + runTest("compiler/testData/writeFlags/lateinit/lateinitProperty.kt"); + } + + @TestMetadata("lateinitPropertyNoSetter.kt") + public void testLateinitPropertyNoSetter() { + runTest("compiler/testData/writeFlags/lateinit/lateinitPropertyNoSetter.kt"); + } + } + + @TestMetadata("compiler/testData/writeFlags/property") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Property extends AbstractFirLightTreeWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInProperty() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/property"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("enumFields.kt") + public void testEnumFields() { + runTest("compiler/testData/writeFlags/property/enumFields.kt"); + } + + @TestMetadata("compiler/testData/writeFlags/property/classObject") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class ClassObject extends AbstractFirLightTreeWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInClassObject() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/property/classObject"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("compiler/testData/writeFlags/property/classObject/class") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Class extends AbstractFirLightTreeWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInClass() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/property/classObject/class"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("delegatedProtectedVar.kt") + public void testDelegatedProtectedVar() { + runTest("compiler/testData/writeFlags/property/classObject/class/delegatedProtectedVar.kt"); + } + + @TestMetadata("delegatedPublicVal.kt") + public void testDelegatedPublicVal() { + runTest("compiler/testData/writeFlags/property/classObject/class/delegatedPublicVal.kt"); + } + + @TestMetadata("internalVal.kt") + public void testInternalVal() { + runTest("compiler/testData/writeFlags/property/classObject/class/internalVal.kt"); + } + + @TestMetadata("internalVar.kt") + public void testInternalVar() { + runTest("compiler/testData/writeFlags/property/classObject/class/internalVar.kt"); + } + + @TestMetadata("internalVarPrivateSet.kt") + public void testInternalVarPrivateSet() { + runTest("compiler/testData/writeFlags/property/classObject/class/internalVarPrivateSet.kt"); + } + + @TestMetadata("noBackingField.kt") + public void testNoBackingField() { + runTest("compiler/testData/writeFlags/property/classObject/class/noBackingField.kt"); + } + + @TestMetadata("privateVal.kt") + public void testPrivateVal() { + runTest("compiler/testData/writeFlags/property/classObject/class/privateVal.kt"); + } + + @TestMetadata("privateVar.kt") + public void testPrivateVar() { + runTest("compiler/testData/writeFlags/property/classObject/class/privateVar.kt"); + } + + @TestMetadata("protectedVal.kt") + public void testProtectedVal() { + runTest("compiler/testData/writeFlags/property/classObject/class/protectedVal.kt"); + } + + @TestMetadata("protectedVarPrivateSet.kt") + public void testProtectedVarPrivateSet() { + runTest("compiler/testData/writeFlags/property/classObject/class/protectedVarPrivateSet.kt"); + } + + @TestMetadata("publicVal.kt") + public void testPublicVal() { + runTest("compiler/testData/writeFlags/property/classObject/class/publicVal.kt"); + } + + @TestMetadata("publicValNonDefault.kt") + public void testPublicValNonDefault() { + runTest("compiler/testData/writeFlags/property/classObject/class/publicValNonDefault.kt"); + } + + @TestMetadata("publicVar.kt") + public void testPublicVar() { + runTest("compiler/testData/writeFlags/property/classObject/class/publicVar.kt"); + } + + @TestMetadata("publicVarNonDefault.kt") + public void testPublicVarNonDefault() { + runTest("compiler/testData/writeFlags/property/classObject/class/publicVarNonDefault.kt"); + } + + @TestMetadata("publicVarPrivateSet.kt") + public void testPublicVarPrivateSet() { + runTest("compiler/testData/writeFlags/property/classObject/class/publicVarPrivateSet.kt"); + } + + @TestMetadata("publicVarProtectedSet.kt") + public void testPublicVarProtectedSet() { + runTest("compiler/testData/writeFlags/property/classObject/class/publicVarProtectedSet.kt"); + } + + @TestMetadata("publicVarPublicSet.kt") + public void testPublicVarPublicSet() { + runTest("compiler/testData/writeFlags/property/classObject/class/publicVarPublicSet.kt"); + } + } + + @TestMetadata("compiler/testData/writeFlags/property/classObject/rename") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Rename extends AbstractFirLightTreeWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInRename() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/property/classObject/rename"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("constructorAndClassObject.kt") + public void testConstructorAndClassObject() { + runTest("compiler/testData/writeFlags/property/classObject/rename/constructorAndClassObject.kt"); + } + + @TestMetadata("delegatedAndDelegated.kt") + public void testDelegatedAndDelegated() { + runTest("compiler/testData/writeFlags/property/classObject/rename/delegatedAndDelegated.kt"); + } + + @TestMetadata("delegatedAndProperty.kt") + public void testDelegatedAndProperty() { + runTest("compiler/testData/writeFlags/property/classObject/rename/delegatedAndProperty.kt"); + } + + @TestMetadata("propertyAndProperty.kt") + public void testPropertyAndProperty() { + runTest("compiler/testData/writeFlags/property/classObject/rename/propertyAndProperty.kt"); + } + } + + @TestMetadata("compiler/testData/writeFlags/property/classObject/trait") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Trait extends AbstractFirLightTreeWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInTrait() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/property/classObject/trait"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("delegatedProtectedVar.kt") + public void testDelegatedProtectedVar() { + runTest("compiler/testData/writeFlags/property/classObject/trait/delegatedProtectedVar.kt"); + } + + @TestMetadata("delegatedPublicVal.kt") + public void testDelegatedPublicVal() { + runTest("compiler/testData/writeFlags/property/classObject/trait/delegatedPublicVal.kt"); + } + + @TestMetadata("internalConstVal.kt") + public void testInternalConstVal() { + runTest("compiler/testData/writeFlags/property/classObject/trait/internalConstVal.kt"); + } + + @TestMetadata("internalVal.kt") + public void testInternalVal() { + runTest("compiler/testData/writeFlags/property/classObject/trait/internalVal.kt"); + } + + @TestMetadata("internalVar.kt") + public void testInternalVar() { + runTest("compiler/testData/writeFlags/property/classObject/trait/internalVar.kt"); + } + + @TestMetadata("internalVarPrivateSet.kt") + public void testInternalVarPrivateSet() { + runTest("compiler/testData/writeFlags/property/classObject/trait/internalVarPrivateSet.kt"); + } + + @TestMetadata("noBackingField.kt") + public void testNoBackingField() { + runTest("compiler/testData/writeFlags/property/classObject/trait/noBackingField.kt"); + } + + @TestMetadata("privateConstVal.kt") + public void testPrivateConstVal() { + runTest("compiler/testData/writeFlags/property/classObject/trait/privateConstVal.kt"); + } + + @TestMetadata("privateVal.kt") + public void testPrivateVal() { + runTest("compiler/testData/writeFlags/property/classObject/trait/privateVal.kt"); + } + + @TestMetadata("privateVar.kt") + public void testPrivateVar() { + runTest("compiler/testData/writeFlags/property/classObject/trait/privateVar.kt"); + } + + @TestMetadata("protectedConstVal.kt") + public void testProtectedConstVal() { + runTest("compiler/testData/writeFlags/property/classObject/trait/protectedConstVal.kt"); + } + + @TestMetadata("protectedVal.kt") + public void testProtectedVal() { + runTest("compiler/testData/writeFlags/property/classObject/trait/protectedVal.kt"); + } + + @TestMetadata("protectedVarPrivateSet.kt") + public void testProtectedVarPrivateSet() { + runTest("compiler/testData/writeFlags/property/classObject/trait/protectedVarPrivateSet.kt"); + } + + @TestMetadata("publicConstVal.kt") + public void testPublicConstVal() { + runTest("compiler/testData/writeFlags/property/classObject/trait/publicConstVal.kt"); + } + + @TestMetadata("publicVal.kt") + public void testPublicVal() { + runTest("compiler/testData/writeFlags/property/classObject/trait/publicVal.kt"); + } + + @TestMetadata("publicValNonDefault.kt") + public void testPublicValNonDefault() { + runTest("compiler/testData/writeFlags/property/classObject/trait/publicValNonDefault.kt"); + } + + @TestMetadata("publicVar.kt") + public void testPublicVar() { + runTest("compiler/testData/writeFlags/property/classObject/trait/publicVar.kt"); + } + + @TestMetadata("publicVarNonDefault.kt") + public void testPublicVarNonDefault() { + runTest("compiler/testData/writeFlags/property/classObject/trait/publicVarNonDefault.kt"); + } + + @TestMetadata("publicVarPrivateSet.kt") + public void testPublicVarPrivateSet() { + runTest("compiler/testData/writeFlags/property/classObject/trait/publicVarPrivateSet.kt"); + } + + @TestMetadata("publicVarProtectedSet.kt") + public void testPublicVarProtectedSet() { + runTest("compiler/testData/writeFlags/property/classObject/trait/publicVarProtectedSet.kt"); + } + + @TestMetadata("publicVarPublicSet.kt") + public void testPublicVarPublicSet() { + runTest("compiler/testData/writeFlags/property/classObject/trait/publicVarPublicSet.kt"); + } + } + } + + @TestMetadata("compiler/testData/writeFlags/property/deprecatedFlag") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class DeprecatedFlag extends AbstractFirLightTreeWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInDeprecatedFlag() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/property/deprecatedFlag"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("propertyInClass.kt") + public void testPropertyInClass() { + runTest("compiler/testData/writeFlags/property/deprecatedFlag/propertyInClass.kt"); + } + + @TestMetadata("topLevelProperty.kt") + public void testTopLevelProperty() { + runTest("compiler/testData/writeFlags/property/deprecatedFlag/topLevelProperty.kt"); + } + } + + @TestMetadata("compiler/testData/writeFlags/property/syntheticAnnotationsMethod") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class SyntheticAnnotationsMethod extends AbstractFirLightTreeWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInSyntheticAnnotationsMethod() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/property/syntheticAnnotationsMethod"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("doNotUseGetterName.kt") + public void testDoNotUseGetterName() { + runTest("compiler/testData/writeFlags/property/syntheticAnnotationsMethod/doNotUseGetterName.kt"); + } + + @TestMetadata("privateProperty.kt") + public void testPrivateProperty() { + runTest("compiler/testData/writeFlags/property/syntheticAnnotationsMethod/privateProperty.kt"); + } + + @TestMetadata("protectedProperty.kt") + public void testProtectedProperty() { + runTest("compiler/testData/writeFlags/property/syntheticAnnotationsMethod/protectedProperty.kt"); + } + + @TestMetadata("publicProperty.kt") + public void testPublicProperty() { + runTest("compiler/testData/writeFlags/property/syntheticAnnotationsMethod/publicProperty.kt"); + } + + @TestMetadata("withGetterJvmName.kt") + public void testWithGetterJvmName() { + runTest("compiler/testData/writeFlags/property/syntheticAnnotationsMethod/withGetterJvmName.kt"); + } + } + + @TestMetadata("compiler/testData/writeFlags/property/visibility") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Visibility extends AbstractFirLightTreeWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInVisibility() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/property/visibility"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("internal.kt") + public void testInternal() { + runTest("compiler/testData/writeFlags/property/visibility/internal.kt"); + } + + @TestMetadata("private.kt") + public void testPrivate() { + runTest("compiler/testData/writeFlags/property/visibility/private.kt"); + } + + @TestMetadata("public.kt") + public void testPublic() { + runTest("compiler/testData/writeFlags/property/visibility/public.kt"); + } + } + } + + @TestMetadata("compiler/testData/writeFlags/typealias") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Typealias extends AbstractFirLightTreeWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInTypealias() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/typealias"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("compiler/testData/writeFlags/typealias/syntheticAnnotationsMethod") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class SyntheticAnnotationsMethod extends AbstractFirLightTreeWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInSyntheticAnnotationsMethod() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/typealias/syntheticAnnotationsMethod"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("privateTypealias.kt") + public void testPrivateTypealias() { + runTest("compiler/testData/writeFlags/typealias/syntheticAnnotationsMethod/privateTypealias.kt"); + } + + @TestMetadata("publicTypealias.kt") + public void testPublicTypealias() { + runTest("compiler/testData/writeFlags/typealias/syntheticAnnotationsMethod/publicTypealias.kt"); + } + } + } +} diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/fir/FirLightTreeWriteSignatureTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/fir/FirLightTreeWriteSignatureTestGenerated.java new file mode 100644 index 00000000000..2451381b8a4 --- /dev/null +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/fir/FirLightTreeWriteSignatureTestGenerated.java @@ -0,0 +1,683 @@ +/* + * Copyright 2010-2024 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.codegen.fir; + +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 java.io.File; +import java.util.regex.Pattern; + +/** This class is generated by {@link org.jetbrains.kotlin.test.generators.GenerateCompilerTestsKt}. DO NOT MODIFY MANUALLY */ +@SuppressWarnings("all") +@TestMetadata("compiler/testData/writeSignature") +@TestDataPath("$PROJECT_ROOT") +@RunWith(JUnit3RunnerWithInners.class) +public class FirLightTreeWriteSignatureTestGenerated extends AbstractFirLightTreeWriteSignatureTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInWriteSignature() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeSignature"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("ArrayOfCharSequence.kt") + public void testArrayOfCharSequence() { + runTest("compiler/testData/writeSignature/ArrayOfCharSequence.kt"); + } + + @TestMetadata("ArrayOfInt.kt") + public void testArrayOfInt() { + runTest("compiler/testData/writeSignature/ArrayOfInt.kt"); + } + + @TestMetadata("backingFieldForGenericDelegated.kt") + public void testBackingFieldForGenericDelegated() { + runTest("compiler/testData/writeSignature/backingFieldForGenericDelegated.kt"); + } + + @TestMetadata("Comparable.kt") + public void testComparable() { + runTest("compiler/testData/writeSignature/Comparable.kt"); + } + + @TestMetadata("DeepGenericInnerClass.kt") + public void testDeepGenericInnerClass() { + runTest("compiler/testData/writeSignature/DeepGenericInnerClass.kt"); + } + + @TestMetadata("GenericInnerClass.kt") + public void testGenericInnerClass() { + runTest("compiler/testData/writeSignature/GenericInnerClass.kt"); + } + + @TestMetadata("GenericInnerClassWithSimpleOuter.kt") + public void testGenericInnerClassWithSimpleOuter() { + runTest("compiler/testData/writeSignature/GenericInnerClassWithSimpleOuter.kt"); + } + + @TestMetadata("Int.kt") + public void testInt() { + runTest("compiler/testData/writeSignature/Int.kt"); + } + + @TestMetadata("IntArray.kt") + public void testIntArray() { + runTest("compiler/testData/writeSignature/IntArray.kt"); + } + + @TestMetadata("IntQ.kt") + public void testIntQ() { + runTest("compiler/testData/writeSignature/IntQ.kt"); + } + + @TestMetadata("jlString.kt") + public void testJlString() { + runTest("compiler/testData/writeSignature/jlString.kt"); + } + + @TestMetadata("ListOfCharSequence.kt") + public void testListOfCharSequence() { + runTest("compiler/testData/writeSignature/ListOfCharSequence.kt"); + } + + @TestMetadata("ListOfStar.kt") + public void testListOfStar() { + runTest("compiler/testData/writeSignature/ListOfStar.kt"); + } + + @TestMetadata("MapEntry.kt") + public void testMapEntry() { + runTest("compiler/testData/writeSignature/MapEntry.kt"); + } + + @TestMetadata("MutableMapEntry.kt") + public void testMutableMapEntry() { + runTest("compiler/testData/writeSignature/MutableMapEntry.kt"); + } + + @TestMetadata("NonGeneric.kt") + public void testNonGeneric() { + runTest("compiler/testData/writeSignature/NonGeneric.kt"); + } + + @TestMetadata("StarProjectionInClass.kt") + public void testStarProjectionInClass() { + runTest("compiler/testData/writeSignature/StarProjectionInClass.kt"); + } + + @TestMetadata("StarProjectionInSuper.kt") + public void testStarProjectionInSuper() { + runTest("compiler/testData/writeSignature/StarProjectionInSuper.kt"); + } + + @TestMetadata("StarProjectionOutsideClass.kt") + public void testStarProjectionOutsideClass() { + runTest("compiler/testData/writeSignature/StarProjectionOutsideClass.kt"); + } + + @TestMetadata("syntheticAccessorForGeneric.kt") + public void testSyntheticAccessorForGeneric() { + runTest("compiler/testData/writeSignature/syntheticAccessorForGeneric.kt"); + } + + @TestMetadata("VarargCharSequence.kt") + public void testVarargCharSequence() { + runTest("compiler/testData/writeSignature/VarargCharSequence.kt"); + } + + @TestMetadata("VarargGeneric.kt") + public void testVarargGeneric() { + runTest("compiler/testData/writeSignature/VarargGeneric.kt"); + } + + @TestMetadata("compiler/testData/writeSignature/annotations") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Annotations extends AbstractFirLightTreeWriteSignatureTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInAnnotations() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeSignature/annotations"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("kArrayClassOfJClass.kt") + public void testKArrayClassOfJClass() { + runTest("compiler/testData/writeSignature/annotations/kArrayClassOfJClass.kt"); + } + + @TestMetadata("kArrayClassOfKClass.kt") + public void testKArrayClassOfKClass() { + runTest("compiler/testData/writeSignature/annotations/kArrayClassOfKClass.kt"); + } + + @TestMetadata("kClassBasic.kt") + public void testKClassBasic() { + runTest("compiler/testData/writeSignature/annotations/kClassBasic.kt"); + } + + @TestMetadata("kClassInt.kt") + public void testKClassInt() { + runTest("compiler/testData/writeSignature/annotations/kClassInt.kt"); + } + + @TestMetadata("kClassOfKClass.kt") + public void testKClassOfKClass() { + runTest("compiler/testData/writeSignature/annotations/kClassOfKClass.kt"); + } + } + + @TestMetadata("compiler/testData/writeSignature/callableReference") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class CallableReference extends AbstractFirLightTreeWriteSignatureTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInCallableReference() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeSignature/callableReference"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("constructorReferenceInReturnType.kt") + public void testConstructorReferenceInReturnType() { + runTest("compiler/testData/writeSignature/callableReference/constructorReferenceInReturnType.kt"); + } + + @TestMetadata("functionReferenceInvoke.kt") + public void testFunctionReferenceInvoke() { + runTest("compiler/testData/writeSignature/callableReference/functionReferenceInvoke.kt"); + } + + @TestMetadata("propertyReferenceGet.kt") + public void testPropertyReferenceGet() { + runTest("compiler/testData/writeSignature/callableReference/propertyReferenceGet.kt"); + } + + @TestMetadata("suspendFunctionReference.kt") + public void testSuspendFunctionReference() { + runTest("compiler/testData/writeSignature/callableReference/suspendFunctionReference.kt"); + } + } + + @TestMetadata("compiler/testData/writeSignature/constructor") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Constructor extends AbstractFirLightTreeWriteSignatureTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInConstructor() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeSignature/constructor"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("Constructor0.kt") + public void testConstructor0() { + runTest("compiler/testData/writeSignature/constructor/Constructor0.kt"); + } + + @TestMetadata("ConstructorCollectionParameter.kt") + public void testConstructorCollectionParameter() { + runTest("compiler/testData/writeSignature/constructor/ConstructorCollectionParameter.kt"); + } + + @TestMetadata("ConstructorWithTypeParameter.kt") + public void testConstructorWithTypeParameter() { + runTest("compiler/testData/writeSignature/constructor/ConstructorWithTypeParameter.kt"); + } + + @TestMetadata("ConstructorWithTypeParameterAndValueParameterP.kt") + public void testConstructorWithTypeParameterAndValueParameterP() { + runTest("compiler/testData/writeSignature/constructor/ConstructorWithTypeParameterAndValueParameterP.kt"); + } + } + + @TestMetadata("compiler/testData/writeSignature/declarationSiteVariance") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class DeclarationSiteVariance extends AbstractFirLightTreeWriteSignatureTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInDeclarationSiteVariance() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeSignature/declarationSiteVariance"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("FunctionTwoTypeParameters.kt") + public void testFunctionTwoTypeParameters() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/FunctionTwoTypeParameters.kt"); + } + + @TestMetadata("GenericOverrides.kt") + public void testGenericOverrides() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/GenericOverrides.kt"); + } + + @TestMetadata("InInInPosition.kt") + public void testInInInPosition() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/InInInPosition.kt"); + } + + @TestMetadata("InInOutPosition.kt") + public void testInInOutPosition() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/InInOutPosition.kt"); + } + + @TestMetadata("InOfInInInPosition.kt") + public void testInOfInInInPosition() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/InOfInInInPosition.kt"); + } + + @TestMetadata("InOfInInOutPosition.kt") + public void testInOfInInOutPosition() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/InOfInInOutPosition.kt"); + } + + @TestMetadata("InOfOutInInPosition.kt") + public void testInOfOutInInPosition() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/InOfOutInInPosition.kt"); + } + + @TestMetadata("InOfOutInOutPosition.kt") + public void testInOfOutInOutPosition() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/InOfOutInOutPosition.kt"); + } + + @TestMetadata("MappedSupertypeWithVariance.kt") + public void testMappedSupertypeWithVariance() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/MappedSupertypeWithVariance.kt"); + } + + @TestMetadata("OpenMembersReturnType.kt") + public void testOpenMembersReturnType() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/OpenMembersReturnType.kt"); + } + + @TestMetadata("OpenMembersValueParameter.kt") + public void testOpenMembersValueParameter() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/OpenMembersValueParameter.kt"); + } + + @TestMetadata("OutInField.kt") + public void testOutInField() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/OutInField.kt"); + } + + @TestMetadata("OutInInPosition.kt") + public void testOutInInPosition() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/OutInInPosition.kt"); + } + + @TestMetadata("OutInOutPosition.kt") + public void testOutInOutPosition() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/OutInOutPosition.kt"); + } + + @TestMetadata("OutOfInInInPosition.kt") + public void testOutOfInInInPosition() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/OutOfInInInPosition.kt"); + } + + @TestMetadata("OutOfInInOutPosition.kt") + public void testOutOfInInOutPosition() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/OutOfInInOutPosition.kt"); + } + + @TestMetadata("OutOfOutInInPosition.kt") + public void testOutOfOutInInPosition() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/OutOfOutInInPosition.kt"); + } + + @TestMetadata("OutOfOutInOutPosition.kt") + public void testOutOfOutInOutPosition() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/OutOfOutInOutPosition.kt"); + } + + @TestMetadata("PropertyGetterIn.kt") + public void testPropertyGetterIn() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/PropertyGetterIn.kt"); + } + + @TestMetadata("PropertyGetterOut.kt") + public void testPropertyGetterOut() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/PropertyGetterOut.kt"); + } + + @TestMetadata("PropertyGetterTwoParams.kt") + public void testPropertyGetterTwoParams() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/PropertyGetterTwoParams.kt"); + } + + @TestMetadata("PropertySetterIn.kt") + public void testPropertySetterIn() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/PropertySetterIn.kt"); + } + + @TestMetadata("PropertySetterOut.kt") + public void testPropertySetterOut() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/PropertySetterOut.kt"); + } + + @TestMetadata("RedundantProjections.kt") + public void testRedundantProjections() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/RedundantProjections.kt"); + } + + @TestMetadata("SuperClassWithVariance.kt") + public void testSuperClassWithVariance() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/SuperClassWithVariance.kt"); + } + + @TestMetadata("SuperTraitWithVariance.kt") + public void testSuperTraitWithVariance() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/SuperTraitWithVariance.kt"); + } + + @TestMetadata("SuperTypeWithVarianceInArguments.kt") + public void testSuperTypeWithVarianceInArguments() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/SuperTypeWithVarianceInArguments.kt"); + } + + @TestMetadata("compiler/testData/writeSignature/declarationSiteVariance/jvmWildcardAnnotations") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class JvmWildcardAnnotations extends AbstractFirLightTreeWriteSignatureTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInJvmWildcardAnnotations() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeSignature/declarationSiteVariance/jvmWildcardAnnotations"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("onFunction.kt") + public void testOnFunction() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/jvmWildcardAnnotations/onFunction.kt"); + } + + @TestMetadata("onTypes.kt") + public void testOnTypes() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/jvmWildcardAnnotations/onTypes.kt"); + } + + @TestMetadata("primitiveTypes.kt") + public void testPrimitiveTypes() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/jvmWildcardAnnotations/primitiveTypes.kt"); + } + } + + @TestMetadata("compiler/testData/writeSignature/declarationSiteVariance/wildcardOptimization") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class WildcardOptimization extends AbstractFirLightTreeWriteSignatureTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInWildcardOptimization() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeSignature/declarationSiteVariance/wildcardOptimization"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("argumentOverridability.kt") + public void testArgumentOverridability() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/wildcardOptimization/argumentOverridability.kt"); + } + + @TestMetadata("arrays.kt") + public void testArrays() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/wildcardOptimization/arrays.kt"); + } + + @TestMetadata("complicatedInBounds.kt") + public void testComplicatedInBounds() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/wildcardOptimization/complicatedInBounds.kt"); + } + + @TestMetadata("deepOut.kt") + public void testDeepOut() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/wildcardOptimization/deepOut.kt"); + } + + @TestMetadata("fields.kt") + public void testFields() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/wildcardOptimization/fields.kt"); + } + + @TestMetadata("finalReturnType.kt") + public void testFinalReturnType() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/wildcardOptimization/finalReturnType.kt"); + } + + @TestMetadata("outIn.kt") + public void testOutIn() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/wildcardOptimization/outIn.kt"); + } + + @TestMetadata("outInv.kt") + public void testOutInv() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/wildcardOptimization/outInv.kt"); + } + + @TestMetadata("topLevelIn.kt") + public void testTopLevelIn() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/wildcardOptimization/topLevelIn.kt"); + } + + @TestMetadata("topLevelInv.kt") + public void testTopLevelInv() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/wildcardOptimization/topLevelInv.kt"); + } + + @TestMetadata("typeParameter.kt") + public void testTypeParameter() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/wildcardOptimization/typeParameter.kt"); + } + } + } + + @TestMetadata("compiler/testData/writeSignature/defaultImpls") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class DefaultImpls extends AbstractFirLightTreeWriteSignatureTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInDefaultImpls() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeSignature/defaultImpls"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("functionTypeParameterClash.kt") + public void testFunctionTypeParameterClash() { + runTest("compiler/testData/writeSignature/defaultImpls/functionTypeParameterClash.kt"); + } + + @TestMetadata("functionTypeParameterClashWith_I.kt") + public void testFunctionTypeParameterClashWith_I() { + runTest("compiler/testData/writeSignature/defaultImpls/functionTypeParameterClashWith_I.kt"); + } + + @TestMetadata("propertyTypeParameterClash.kt") + public void testPropertyTypeParameterClash() { + runTest("compiler/testData/writeSignature/defaultImpls/propertyTypeParameterClash.kt"); + } + } + + @TestMetadata("compiler/testData/writeSignature/inlineClasses") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class InlineClasses extends AbstractFirLightTreeWriteSignatureTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInInlineClasses() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeSignature/inlineClasses"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("basicInlineClassDeclarationCodegen.kt") + public void testBasicInlineClassDeclarationCodegen() { + runTest("compiler/testData/writeSignature/inlineClasses/basicInlineClassDeclarationCodegen.kt"); + } + + @TestMetadata("genericInlineClassBasedOnGenericType.kt") + public void testGenericInlineClassBasedOnGenericType() { + runTest("compiler/testData/writeSignature/inlineClasses/genericInlineClassBasedOnGenericType.kt"); + } + + @TestMetadata("genericMethodInsideClass.kt") + public void testGenericMethodInsideClass() { + runTest("compiler/testData/writeSignature/inlineClasses/genericMethodInsideClass.kt"); + } + + @TestMetadata("inlineClassAsGenericArgument.kt") + public void testInlineClassAsGenericArgument() { + runTest("compiler/testData/writeSignature/inlineClasses/inlineClassAsGenericArgument.kt"); + } + + @TestMetadata("inlineClassBasedOnOtherInlineClass.kt") + public void testInlineClassBasedOnOtherInlineClass() { + runTest("compiler/testData/writeSignature/inlineClasses/inlineClassBasedOnOtherInlineClass.kt"); + } + + @TestMetadata("inlineClassWithComplexSubstitutedType.kt") + public void testInlineClassWithComplexSubstitutedType() { + runTest("compiler/testData/writeSignature/inlineClasses/inlineClassWithComplexSubstitutedType.kt"); + } + + @TestMetadata("inlineClassesInsideFunctionalTypes.kt") + public void testInlineClassesInsideFunctionalTypes() { + runTest("compiler/testData/writeSignature/inlineClasses/inlineClassesInsideFunctionalTypes.kt"); + } + + @TestMetadata("nullableInlineClassType.kt") + public void testNullableInlineClassType() { + runTest("compiler/testData/writeSignature/inlineClasses/nullableInlineClassType.kt"); + } + + @TestMetadata("simpleSignatureWithInlineClassTypesAsPrimitive.kt") + public void testSimpleSignatureWithInlineClassTypesAsPrimitive() { + runTest("compiler/testData/writeSignature/inlineClasses/simpleSignatureWithInlineClassTypesAsPrimitive.kt"); + } + + @TestMetadata("simpleSignatureWithInlineClassTypesAsReference.kt") + public void testSimpleSignatureWithInlineClassTypesAsReference() { + runTest("compiler/testData/writeSignature/inlineClasses/simpleSignatureWithInlineClassTypesAsReference.kt"); + } + } + + @TestMetadata("compiler/testData/writeSignature/java8") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Java8 extends AbstractFirLightTreeWriteSignatureTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInJava8() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeSignature/java8"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("mutableMapRemove.kt") + public void testMutableMapRemove() { + runTest("compiler/testData/writeSignature/java8/mutableMapRemove.kt"); + } + } + + @TestMetadata("compiler/testData/writeSignature/nothing") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Nothing extends AbstractFirLightTreeWriteSignatureTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInNothing() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeSignature/nothing"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("nothing.kt") + public void testNothing() { + runTest("compiler/testData/writeSignature/nothing/nothing.kt"); + } + + @TestMetadata("nullableNothing.kt") + public void testNullableNothing() { + runTest("compiler/testData/writeSignature/nothing/nullableNothing.kt"); + } + } + + @TestMetadata("compiler/testData/writeSignature/parameterlessMain") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class ParameterlessMain extends AbstractFirLightTreeWriteSignatureTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInParameterlessMain() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeSignature/parameterlessMain"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("arrayWithContravariantStringIsNotMainMethod.kt") + public void testArrayWithContravariantStringIsNotMainMethod() { + runTest("compiler/testData/writeSignature/parameterlessMain/arrayWithContravariantStringIsNotMainMethod.kt"); + } + + @TestMetadata("impostorMains.kt") + public void testImpostorMains() { + runTest("compiler/testData/writeSignature/parameterlessMain/impostorMains.kt"); + } + + @TestMetadata("main.kt") + public void testMain() { + runTest("compiler/testData/writeSignature/parameterlessMain/main.kt"); + } + + @TestMetadata("notJvmMainName.kt") + public void testNotJvmMainName() { + runTest("compiler/testData/writeSignature/parameterlessMain/notJvmMainName.kt"); + } + + @TestMetadata("simple.kt") + public void testSimple() { + runTest("compiler/testData/writeSignature/parameterlessMain/simple.kt"); + } + } + + @TestMetadata("compiler/testData/writeSignature/suspendMain") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class SuspendMain extends AbstractFirLightTreeWriteSignatureTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInSuspendMain() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeSignature/suspendMain"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("parameterlessSuspendMain.kt") + public void testParameterlessSuspendMain() { + runTest("compiler/testData/writeSignature/suspendMain/parameterlessSuspendMain.kt"); + } + + @TestMetadata("suspendMain.kt") + public void testSuspendMain() { + runTest("compiler/testData/writeSignature/suspendMain/suspendMain.kt"); + } + } +} diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/fir/FirPsiCheckLocalVariablesTableTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/fir/FirPsiCheckLocalVariablesTableTestGenerated.java new file mode 100644 index 00000000000..e43dbef6325 --- /dev/null +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/fir/FirPsiCheckLocalVariablesTableTestGenerated.java @@ -0,0 +1,135 @@ +/* + * Copyright 2010-2024 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.codegen.fir; + +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 java.io.File; +import java.util.regex.Pattern; + +/** This class is generated by {@link org.jetbrains.kotlin.test.generators.GenerateCompilerTestsKt}. DO NOT MODIFY MANUALLY */ +@SuppressWarnings("all") +@TestMetadata("compiler/testData/checkLocalVariablesTable") +@TestDataPath("$PROJECT_ROOT") +@RunWith(JUnit3RunnerWithInners.class) +public class FirPsiCheckLocalVariablesTableTestGenerated extends AbstractFirPsiCheckLocalVariablesTableTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInCheckLocalVariablesTable() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/checkLocalVariablesTable"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("destructuringInLambdas.kt") + public void testDestructuringInLambdas() { + runTest("compiler/testData/checkLocalVariablesTable/destructuringInLambdas.kt"); + } + + @TestMetadata("inlineLambdaWithItParam.kt") + public void testInlineLambdaWithItParam() { + runTest("compiler/testData/checkLocalVariablesTable/inlineLambdaWithItParam.kt"); + } + + @TestMetadata("inlineLambdaWithParam.kt") + public void testInlineLambdaWithParam() { + runTest("compiler/testData/checkLocalVariablesTable/inlineLambdaWithParam.kt"); + } + + @TestMetadata("inlineSimple.kt") + public void testInlineSimple() { + runTest("compiler/testData/checkLocalVariablesTable/inlineSimple.kt"); + } + + @TestMetadata("inlineSimpleChain.kt") + public void testInlineSimpleChain() { + runTest("compiler/testData/checkLocalVariablesTable/inlineSimpleChain.kt"); + } + + @TestMetadata("itInLambda.kt") + public void testItInLambda() { + runTest("compiler/testData/checkLocalVariablesTable/itInLambda.kt"); + } + + @TestMetadata("itInReturnedLambda.kt") + public void testItInReturnedLambda() { + runTest("compiler/testData/checkLocalVariablesTable/itInReturnedLambda.kt"); + } + + @TestMetadata("kt11117.kt") + public void testKt11117() { + runTest("compiler/testData/checkLocalVariablesTable/kt11117.kt"); + } + + @TestMetadata("lambdaAsVar.kt") + public void testLambdaAsVar() { + runTest("compiler/testData/checkLocalVariablesTable/lambdaAsVar.kt"); + } + + @TestMetadata("objectInLocalPropertyDelegate.kt") + public void testObjectInLocalPropertyDelegate() { + runTest("compiler/testData/checkLocalVariablesTable/objectInLocalPropertyDelegate.kt"); + } + + @TestMetadata("suspendFunctionDeadVariables.kt") + public void testSuspendFunctionDeadVariables() { + runTest("compiler/testData/checkLocalVariablesTable/suspendFunctionDeadVariables.kt"); + } + + @TestMetadata("underscoreNames.kt") + public void testUnderscoreNames() { + runTest("compiler/testData/checkLocalVariablesTable/underscoreNames.kt"); + } + + @TestMetadata("compiler/testData/checkLocalVariablesTable/parametersInSuspendLambda") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class ParametersInSuspendLambda extends AbstractFirPsiCheckLocalVariablesTableTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInParametersInSuspendLambda() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/checkLocalVariablesTable/parametersInSuspendLambda"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("dataClass.kt") + public void testDataClass() { + runTest("compiler/testData/checkLocalVariablesTable/parametersInSuspendLambda/dataClass.kt"); + } + + @TestMetadata("extensionComponents.kt") + public void testExtensionComponents() { + runTest("compiler/testData/checkLocalVariablesTable/parametersInSuspendLambda/extensionComponents.kt"); + } + + @TestMetadata("generic.kt") + public void testGeneric() { + runTest("compiler/testData/checkLocalVariablesTable/parametersInSuspendLambda/generic.kt"); + } + + @TestMetadata("inline.kt") + public void testInline() { + runTest("compiler/testData/checkLocalVariablesTable/parametersInSuspendLambda/inline.kt"); + } + + @TestMetadata("otherParameters.kt") + public void testOtherParameters() { + runTest("compiler/testData/checkLocalVariablesTable/parametersInSuspendLambda/otherParameters.kt"); + } + + @TestMetadata("parameters.kt") + public void testParameters() { + runTest("compiler/testData/checkLocalVariablesTable/parametersInSuspendLambda/parameters.kt"); + } + } +} diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/fir/FirPsiWriteFlagsTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/fir/FirPsiWriteFlagsTestGenerated.java new file mode 100644 index 00000000000..3e92ae9150a --- /dev/null +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/fir/FirPsiWriteFlagsTestGenerated.java @@ -0,0 +1,1288 @@ +/* + * Copyright 2010-2024 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.codegen.fir; + +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 java.io.File; +import java.util.regex.Pattern; + +/** This class is generated by {@link org.jetbrains.kotlin.test.generators.GenerateCompilerTestsKt}. DO NOT MODIFY MANUALLY */ +@SuppressWarnings("all") +@TestMetadata("compiler/testData/writeFlags") +@TestDataPath("$PROJECT_ROOT") +@RunWith(JUnit3RunnerWithInners.class) +public class FirPsiWriteFlagsTestGenerated extends AbstractFirPsiWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInWriteFlags() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("protectedAccessToBaseMethod.kt") + public void testProtectedAccessToBaseMethod() { + runTest("compiler/testData/writeFlags/protectedAccessToBaseMethod.kt"); + } + + @TestMetadata("protectedAccessToBaseMethodDifferentPackage.kt") + public void testProtectedAccessToBaseMethodDifferentPackage() { + runTest("compiler/testData/writeFlags/protectedAccessToBaseMethodDifferentPackage.kt"); + } + + @TestMetadata("compiler/testData/writeFlags/callableReference") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class CallableReference extends AbstractFirPsiWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInCallableReference() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/callableReference"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("compiler/testData/writeFlags/callableReference/flags") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Flags extends AbstractFirPsiWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInFlags() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/callableReference/flags"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("functionReference.kt") + public void testFunctionReference() { + runTest("compiler/testData/writeFlags/callableReference/flags/functionReference.kt"); + } + + @TestMetadata("functionReferenceInInlineFunction.kt") + public void testFunctionReferenceInInlineFunction() { + runTest("compiler/testData/writeFlags/callableReference/flags/functionReferenceInInlineFunction.kt"); + } + + @TestMetadata("propertyReference.kt") + public void testPropertyReference() { + runTest("compiler/testData/writeFlags/callableReference/flags/propertyReference.kt"); + } + + @TestMetadata("propertyReferenceInInlineFunction.kt") + public void testPropertyReferenceInInlineFunction() { + runTest("compiler/testData/writeFlags/callableReference/flags/propertyReferenceInInlineFunction.kt"); + } + } + } + + @TestMetadata("compiler/testData/writeFlags/class") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Class extends AbstractFirPsiWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInClass() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/class"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("compiler/testData/writeFlags/class/accessFlags") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class AccessFlags extends AbstractFirPsiWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInAccessFlags() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/class/accessFlags"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("defaultImpls.kt") + public void testDefaultImpls() { + runTest("compiler/testData/writeFlags/class/accessFlags/defaultImpls.kt"); + } + + @TestMetadata("innerSealed.kt") + public void testInnerSealed() { + runTest("compiler/testData/writeFlags/class/accessFlags/innerSealed.kt"); + } + + @TestMetadata("mappingWhen.kt") + public void testMappingWhen() { + runTest("compiler/testData/writeFlags/class/accessFlags/mappingWhen.kt"); + } + + @TestMetadata("objectLiteral.kt") + public void testObjectLiteral() { + runTest("compiler/testData/writeFlags/class/accessFlags/objectLiteral.kt"); + } + + @TestMetadata("publicFinalClass.kt") + public void testPublicFinalClass() { + runTest("compiler/testData/writeFlags/class/accessFlags/publicFinalClass.kt"); + } + + @TestMetadata("publicFinalInnerClass.kt") + public void testPublicFinalInnerClass() { + runTest("compiler/testData/writeFlags/class/accessFlags/publicFinalInnerClass.kt"); + } + + @TestMetadata("publicInnerInterface.kt") + public void testPublicInnerInterface() { + runTest("compiler/testData/writeFlags/class/accessFlags/publicInnerInterface.kt"); + } + + @TestMetadata("publicInterface.kt") + public void testPublicInterface() { + runTest("compiler/testData/writeFlags/class/accessFlags/publicInterface.kt"); + } + + @TestMetadata("simpleFilePackageFacade.kt") + public void testSimpleFilePackageFacade() { + runTest("compiler/testData/writeFlags/class/accessFlags/simpleFilePackageFacade.kt"); + } + + @TestMetadata("syntheticFile.kt") + public void testSyntheticFile() { + runTest("compiler/testData/writeFlags/class/accessFlags/syntheticFile.kt"); + } + } + + @TestMetadata("compiler/testData/writeFlags/class/deprecatedFlag") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class DeprecatedFlag extends AbstractFirPsiWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInDeprecatedFlag() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/class/deprecatedFlag"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("class.kt") + public void testClass() { + runTest("compiler/testData/writeFlags/class/deprecatedFlag/class.kt"); + } + + @TestMetadata("classObject.kt") + public void testClassObject() { + runTest("compiler/testData/writeFlags/class/deprecatedFlag/classObject.kt"); + } + + @TestMetadata("enumClass.kt") + public void testEnumClass() { + runTest("compiler/testData/writeFlags/class/deprecatedFlag/enumClass.kt"); + } + + @TestMetadata("innerClass.kt") + public void testInnerClass() { + runTest("compiler/testData/writeFlags/class/deprecatedFlag/innerClass.kt"); + } + + @TestMetadata("trait.kt") + public void testTrait() { + runTest("compiler/testData/writeFlags/class/deprecatedFlag/trait.kt"); + } + } + + @TestMetadata("compiler/testData/writeFlags/class/visibility") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Visibility extends AbstractFirPsiWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInVisibility() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/class/visibility"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("compiler/testData/writeFlags/class/visibility/internal") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Internal extends AbstractFirPsiWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInInternal() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/class/visibility/internal"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("class.kt") + public void testClass() { + runTest("compiler/testData/writeFlags/class/visibility/internal/class.kt"); + } + + @TestMetadata("enum.kt") + public void testEnum() { + runTest("compiler/testData/writeFlags/class/visibility/internal/enum.kt"); + } + + @TestMetadata("innerClass.kt") + public void testInnerClass() { + runTest("compiler/testData/writeFlags/class/visibility/internal/innerClass.kt"); + } + + @TestMetadata("innerEnum.kt") + public void testInnerEnum() { + runTest("compiler/testData/writeFlags/class/visibility/internal/innerEnum.kt"); + } + + @TestMetadata("innerObject.kt") + public void testInnerObject() { + runTest("compiler/testData/writeFlags/class/visibility/internal/innerObject.kt"); + } + + @TestMetadata("innerTrait.kt") + public void testInnerTrait() { + runTest("compiler/testData/writeFlags/class/visibility/internal/innerTrait.kt"); + } + + @TestMetadata("object.kt") + public void testObject() { + runTest("compiler/testData/writeFlags/class/visibility/internal/object.kt"); + } + + @TestMetadata("trait.kt") + public void testTrait() { + runTest("compiler/testData/writeFlags/class/visibility/internal/trait.kt"); + } + } + + @TestMetadata("compiler/testData/writeFlags/class/visibility/packageprivate") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Packageprivate extends AbstractFirPsiWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInPackageprivate() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/class/visibility/packageprivate"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("enumEntry.kt") + public void testEnumEntry() { + runTest("compiler/testData/writeFlags/class/visibility/packageprivate/enumEntry.kt"); + } + } + + @TestMetadata("compiler/testData/writeFlags/class/visibility/private") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Private extends AbstractFirPsiWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInPrivate() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/class/visibility/private"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("class.kt") + public void testClass() { + runTest("compiler/testData/writeFlags/class/visibility/private/class.kt"); + } + + @TestMetadata("enum.kt") + public void testEnum() { + runTest("compiler/testData/writeFlags/class/visibility/private/enum.kt"); + } + + @TestMetadata("innerClass.kt") + public void testInnerClass() { + runTest("compiler/testData/writeFlags/class/visibility/private/innerClass.kt"); + } + + @TestMetadata("innerEnum.kt") + public void testInnerEnum() { + runTest("compiler/testData/writeFlags/class/visibility/private/innerEnum.kt"); + } + + @TestMetadata("innerObject.kt") + public void testInnerObject() { + runTest("compiler/testData/writeFlags/class/visibility/private/innerObject.kt"); + } + + @TestMetadata("innerTrait.kt") + public void testInnerTrait() { + runTest("compiler/testData/writeFlags/class/visibility/private/innerTrait.kt"); + } + + @TestMetadata("object.kt") + public void testObject() { + runTest("compiler/testData/writeFlags/class/visibility/private/object.kt"); + } + + @TestMetadata("trait.kt") + public void testTrait() { + runTest("compiler/testData/writeFlags/class/visibility/private/trait.kt"); + } + } + + @TestMetadata("compiler/testData/writeFlags/class/visibility/public") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Public extends AbstractFirPsiWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInPublic() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/class/visibility/public"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("class.kt") + public void testClass() { + runTest("compiler/testData/writeFlags/class/visibility/public/class.kt"); + } + + @TestMetadata("enum.kt") + public void testEnum() { + runTest("compiler/testData/writeFlags/class/visibility/public/enum.kt"); + } + + @TestMetadata("innerClass.kt") + public void testInnerClass() { + runTest("compiler/testData/writeFlags/class/visibility/public/innerClass.kt"); + } + + @TestMetadata("innerEnum.kt") + public void testInnerEnum() { + runTest("compiler/testData/writeFlags/class/visibility/public/innerEnum.kt"); + } + + @TestMetadata("innerObject.kt") + public void testInnerObject() { + runTest("compiler/testData/writeFlags/class/visibility/public/innerObject.kt"); + } + + @TestMetadata("innerTrait.kt") + public void testInnerTrait() { + runTest("compiler/testData/writeFlags/class/visibility/public/innerTrait.kt"); + } + + @TestMetadata("object.kt") + public void testObject() { + runTest("compiler/testData/writeFlags/class/visibility/public/object.kt"); + } + + @TestMetadata("trait.kt") + public void testTrait() { + runTest("compiler/testData/writeFlags/class/visibility/public/trait.kt"); + } + } + } + } + + @TestMetadata("compiler/testData/writeFlags/delegatedProperty") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class DelegatedProperty extends AbstractFirPsiWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInDelegatedProperty() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/delegatedProperty"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("compiler/testData/writeFlags/delegatedProperty/visibility") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Visibility extends AbstractFirPsiWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInVisibility() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/delegatedProperty/visibility"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("privateSet.kt") + public void testPrivateSet() { + runTest("compiler/testData/writeFlags/delegatedProperty/visibility/privateSet.kt"); + } + } + } + + @TestMetadata("compiler/testData/writeFlags/function") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Function extends AbstractFirPsiWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInFunction() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/function"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("compiler/testData/writeFlags/function/classObjectPrivate") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class ClassObjectPrivate extends AbstractFirPsiWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInClassObjectPrivate() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/function/classObjectPrivate"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("privateFun.kt") + public void testPrivateFun() { + runTest("compiler/testData/writeFlags/function/classObjectPrivate/privateFun.kt"); + } + + @TestMetadata("privateVal.kt") + public void testPrivateVal() { + runTest("compiler/testData/writeFlags/function/classObjectPrivate/privateVal.kt"); + } + + @TestMetadata("privateVar.kt") + public void testPrivateVar() { + runTest("compiler/testData/writeFlags/function/classObjectPrivate/privateVar.kt"); + } + } + + @TestMetadata("compiler/testData/writeFlags/function/constructors") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Constructors extends AbstractFirPsiWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInConstructors() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/function/constructors"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("classObject.kt") + public void testClassObject() { + runTest("compiler/testData/writeFlags/function/constructors/classObject.kt"); + } + + @TestMetadata("enum.kt") + public void testEnum() { + runTest("compiler/testData/writeFlags/function/constructors/enum.kt"); + } + + @TestMetadata("localClass.kt") + public void testLocalClass() { + runTest("compiler/testData/writeFlags/function/constructors/localClass.kt"); + } + + @TestMetadata("objectInClass.kt") + public void testObjectInClass() { + runTest("compiler/testData/writeFlags/function/constructors/objectInClass.kt"); + } + + @TestMetadata("objectLiteral.kt") + public void testObjectLiteral() { + runTest("compiler/testData/writeFlags/function/constructors/objectLiteral.kt"); + } + + @TestMetadata("topLevelObject.kt") + public void testTopLevelObject() { + runTest("compiler/testData/writeFlags/function/constructors/topLevelObject.kt"); + } + + @TestMetadata("withMangledArguments.kt") + public void testWithMangledArguments() { + runTest("compiler/testData/writeFlags/function/constructors/withMangledArguments.kt"); + } + } + + @TestMetadata("compiler/testData/writeFlags/function/deprecatedFlag") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class DeprecatedFlag extends AbstractFirPsiWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInDeprecatedFlag() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/function/deprecatedFlag"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("deprecatedSinceKotlin.kt") + public void testDeprecatedSinceKotlin() { + runTest("compiler/testData/writeFlags/function/deprecatedFlag/deprecatedSinceKotlin.kt"); + } + + @TestMetadata("emptyGetter.kt") + public void testEmptyGetter() { + runTest("compiler/testData/writeFlags/function/deprecatedFlag/emptyGetter.kt"); + } + + @TestMetadata("emptySetter.kt") + public void testEmptySetter() { + runTest("compiler/testData/writeFlags/function/deprecatedFlag/emptySetter.kt"); + } + + @TestMetadata("extentionFun.kt") + public void testExtentionFun() { + runTest("compiler/testData/writeFlags/function/deprecatedFlag/extentionFun.kt"); + } + + @TestMetadata("funInClass.kt") + public void testFunInClass() { + runTest("compiler/testData/writeFlags/function/deprecatedFlag/funInClass.kt"); + } + + @TestMetadata("funInClassObject.kt") + public void testFunInClassObject() { + runTest("compiler/testData/writeFlags/function/deprecatedFlag/funInClassObject.kt"); + } + + @TestMetadata("getter.kt") + public void testGetter() { + runTest("compiler/testData/writeFlags/function/deprecatedFlag/getter.kt"); + } + + @TestMetadata("getterAnnotationOnProperty.kt") + public void testGetterAnnotationOnProperty() { + runTest("compiler/testData/writeFlags/function/deprecatedFlag/getterAnnotationOnProperty.kt"); + } + + @TestMetadata("getterForPropertyInConstructor.kt") + public void testGetterForPropertyInConstructor() { + runTest("compiler/testData/writeFlags/function/deprecatedFlag/getterForPropertyInConstructor.kt"); + } + + @TestMetadata("setter.kt") + public void testSetter() { + runTest("compiler/testData/writeFlags/function/deprecatedFlag/setter.kt"); + } + + @TestMetadata("setterAnnotationOnProperty.kt") + public void testSetterAnnotationOnProperty() { + runTest("compiler/testData/writeFlags/function/deprecatedFlag/setterAnnotationOnProperty.kt"); + } + + @TestMetadata("setterForPropertyInConstructor.kt") + public void testSetterForPropertyInConstructor() { + runTest("compiler/testData/writeFlags/function/deprecatedFlag/setterForPropertyInConstructor.kt"); + } + + @TestMetadata("topLevelFun.kt") + public void testTopLevelFun() { + runTest("compiler/testData/writeFlags/function/deprecatedFlag/topLevelFun.kt"); + } + } + + @TestMetadata("compiler/testData/writeFlags/function/withDefaultArguments") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class WithDefaultArguments extends AbstractFirPsiWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInWithDefaultArguments() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/function/withDefaultArguments"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("funInClass.kt") + public void testFunInClass() { + runTest("compiler/testData/writeFlags/function/withDefaultArguments/funInClass.kt"); + } + + @TestMetadata("funInClassObject.kt") + public void testFunInClassObject() { + runTest("compiler/testData/writeFlags/function/withDefaultArguments/funInClassObject.kt"); + } + + @TestMetadata("inlineOnlyFunInClass.kt") + public void testInlineOnlyFunInClass() { + runTest("compiler/testData/writeFlags/function/withDefaultArguments/inlineOnlyFunInClass.kt"); + } + + @TestMetadata("reifiedFunInClass.kt") + public void testReifiedFunInClass() { + runTest("compiler/testData/writeFlags/function/withDefaultArguments/reifiedFunInClass.kt"); + } + + @TestMetadata("topLevelFun.kt") + public void testTopLevelFun() { + runTest("compiler/testData/writeFlags/function/withDefaultArguments/topLevelFun.kt"); + } + } + } + + @TestMetadata("compiler/testData/writeFlags/hidden") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Hidden extends AbstractFirPsiWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInHidden() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/hidden"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("function.kt") + public void testFunction() { + runTest("compiler/testData/writeFlags/hidden/function.kt"); + } + + @TestMetadata("propertyGetter.kt") + public void testPropertyGetter() { + runTest("compiler/testData/writeFlags/hidden/propertyGetter.kt"); + } + + @TestMetadata("propertySetter.kt") + public void testPropertySetter() { + runTest("compiler/testData/writeFlags/hidden/propertySetter.kt"); + } + } + + @TestMetadata("compiler/testData/writeFlags/inline") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Inline extends AbstractFirPsiWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInInline() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/inline"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("inlineOnly.kt") + public void testInlineOnly() { + runTest("compiler/testData/writeFlags/inline/inlineOnly.kt"); + } + + @TestMetadata("lostInnerClass.kt") + public void testLostInnerClass() { + runTest("compiler/testData/writeFlags/inline/lostInnerClass.kt"); + } + + @TestMetadata("lostInnerClass2.kt") + public void testLostInnerClass2() { + runTest("compiler/testData/writeFlags/inline/lostInnerClass2.kt"); + } + + @TestMetadata("lostInnerClass3.kt") + public void testLostInnerClass3() { + runTest("compiler/testData/writeFlags/inline/lostInnerClass3.kt"); + } + } + + @TestMetadata("compiler/testData/writeFlags/innerClass") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class InnerClass extends AbstractFirPsiWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInInnerClass() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/innerClass"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("compiler/testData/writeFlags/innerClass/visibility") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Visibility extends AbstractFirPsiWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInVisibility() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/innerClass/visibility"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("internal.kt") + public void testInternal() { + runTest("compiler/testData/writeFlags/innerClass/visibility/internal.kt"); + } + + @TestMetadata("internalClassObject.kt") + public void testInternalClassObject() { + runTest("compiler/testData/writeFlags/innerClass/visibility/internalClassObject.kt"); + } + + @TestMetadata("private.kt") + public void testPrivate() { + runTest("compiler/testData/writeFlags/innerClass/visibility/private.kt"); + } + + @TestMetadata("privateClassObject.kt") + public void testPrivateClassObject() { + runTest("compiler/testData/writeFlags/innerClass/visibility/privateClassObject.kt"); + } + + @TestMetadata("public.kt") + public void testPublic() { + runTest("compiler/testData/writeFlags/innerClass/visibility/public.kt"); + } + + @TestMetadata("publicClassObject.kt") + public void testPublicClassObject() { + runTest("compiler/testData/writeFlags/innerClass/visibility/publicClassObject.kt"); + } + } + } + + @TestMetadata("compiler/testData/writeFlags/jvm8") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Jvm8 extends AbstractFirPsiWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInJvm8() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/jvm8"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("interfaceMethod.kt") + public void testInterfaceMethod() { + runTest("compiler/testData/writeFlags/jvm8/interfaceMethod.kt"); + } + + @TestMetadata("interfaceProperty.kt") + public void testInterfaceProperty() { + runTest("compiler/testData/writeFlags/jvm8/interfaceProperty.kt"); + } + + @TestMetadata("compiler/testData/writeFlags/jvm8/defaults") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Defaults extends AbstractFirPsiWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInDefaults() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/jvm8/defaults"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("compiler/testData/writeFlags/jvm8/defaults/all-compatibility") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class All_compatibility extends AbstractFirPsiWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInAll_compatibility() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/jvm8/defaults/all-compatibility"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("defaultImplementations.kt") + public void testDefaultImplementations() { + runTest("compiler/testData/writeFlags/jvm8/defaults/all-compatibility/defaultImplementations.kt"); + } + + @TestMetadata("propertyAccessors.kt") + public void testPropertyAccessors() { + runTest("compiler/testData/writeFlags/jvm8/defaults/all-compatibility/propertyAccessors.kt"); + } + + @TestMetadata("propertyAnnotation.kt") + public void testPropertyAnnotation() { + runTest("compiler/testData/writeFlags/jvm8/defaults/all-compatibility/propertyAnnotation.kt"); + } + } + } + } + + @TestMetadata("compiler/testData/writeFlags/jvmOverloads") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class JvmOverloads extends AbstractFirPsiWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInJvmOverloads() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/jvmOverloads"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("openFunction.kt") + public void testOpenFunction() { + runTest("compiler/testData/writeFlags/jvmOverloads/openFunction.kt"); + } + + @TestMetadata("openFunction_1_3.kt") + public void testOpenFunction_1_3() { + runTest("compiler/testData/writeFlags/jvmOverloads/openFunction_1_3.kt"); + } + } + + @TestMetadata("compiler/testData/writeFlags/lambda") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Lambda extends AbstractFirPsiWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInLambda() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/lambda"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("lambdaInInlineFunction.kt") + public void testLambdaInInlineFunction() { + runTest("compiler/testData/writeFlags/lambda/lambdaInInlineFunction.kt"); + } + + @TestMetadata("simpleLambda.kt") + public void testSimpleLambda() { + runTest("compiler/testData/writeFlags/lambda/simpleLambda.kt"); + } + } + + @TestMetadata("compiler/testData/writeFlags/lateinit") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Lateinit extends AbstractFirPsiWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInLateinit() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/lateinit"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("lateinitGetter.kt") + public void testLateinitGetter() { + runTest("compiler/testData/writeFlags/lateinit/lateinitGetter.kt"); + } + + @TestMetadata("lateinitProperty.kt") + public void testLateinitProperty() { + runTest("compiler/testData/writeFlags/lateinit/lateinitProperty.kt"); + } + + @TestMetadata("lateinitPropertyNoSetter.kt") + public void testLateinitPropertyNoSetter() { + runTest("compiler/testData/writeFlags/lateinit/lateinitPropertyNoSetter.kt"); + } + } + + @TestMetadata("compiler/testData/writeFlags/property") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Property extends AbstractFirPsiWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInProperty() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/property"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("enumFields.kt") + public void testEnumFields() { + runTest("compiler/testData/writeFlags/property/enumFields.kt"); + } + + @TestMetadata("compiler/testData/writeFlags/property/classObject") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class ClassObject extends AbstractFirPsiWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInClassObject() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/property/classObject"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("compiler/testData/writeFlags/property/classObject/class") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Class extends AbstractFirPsiWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInClass() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/property/classObject/class"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("delegatedProtectedVar.kt") + public void testDelegatedProtectedVar() { + runTest("compiler/testData/writeFlags/property/classObject/class/delegatedProtectedVar.kt"); + } + + @TestMetadata("delegatedPublicVal.kt") + public void testDelegatedPublicVal() { + runTest("compiler/testData/writeFlags/property/classObject/class/delegatedPublicVal.kt"); + } + + @TestMetadata("internalVal.kt") + public void testInternalVal() { + runTest("compiler/testData/writeFlags/property/classObject/class/internalVal.kt"); + } + + @TestMetadata("internalVar.kt") + public void testInternalVar() { + runTest("compiler/testData/writeFlags/property/classObject/class/internalVar.kt"); + } + + @TestMetadata("internalVarPrivateSet.kt") + public void testInternalVarPrivateSet() { + runTest("compiler/testData/writeFlags/property/classObject/class/internalVarPrivateSet.kt"); + } + + @TestMetadata("noBackingField.kt") + public void testNoBackingField() { + runTest("compiler/testData/writeFlags/property/classObject/class/noBackingField.kt"); + } + + @TestMetadata("privateVal.kt") + public void testPrivateVal() { + runTest("compiler/testData/writeFlags/property/classObject/class/privateVal.kt"); + } + + @TestMetadata("privateVar.kt") + public void testPrivateVar() { + runTest("compiler/testData/writeFlags/property/classObject/class/privateVar.kt"); + } + + @TestMetadata("protectedVal.kt") + public void testProtectedVal() { + runTest("compiler/testData/writeFlags/property/classObject/class/protectedVal.kt"); + } + + @TestMetadata("protectedVarPrivateSet.kt") + public void testProtectedVarPrivateSet() { + runTest("compiler/testData/writeFlags/property/classObject/class/protectedVarPrivateSet.kt"); + } + + @TestMetadata("publicVal.kt") + public void testPublicVal() { + runTest("compiler/testData/writeFlags/property/classObject/class/publicVal.kt"); + } + + @TestMetadata("publicValNonDefault.kt") + public void testPublicValNonDefault() { + runTest("compiler/testData/writeFlags/property/classObject/class/publicValNonDefault.kt"); + } + + @TestMetadata("publicVar.kt") + public void testPublicVar() { + runTest("compiler/testData/writeFlags/property/classObject/class/publicVar.kt"); + } + + @TestMetadata("publicVarNonDefault.kt") + public void testPublicVarNonDefault() { + runTest("compiler/testData/writeFlags/property/classObject/class/publicVarNonDefault.kt"); + } + + @TestMetadata("publicVarPrivateSet.kt") + public void testPublicVarPrivateSet() { + runTest("compiler/testData/writeFlags/property/classObject/class/publicVarPrivateSet.kt"); + } + + @TestMetadata("publicVarProtectedSet.kt") + public void testPublicVarProtectedSet() { + runTest("compiler/testData/writeFlags/property/classObject/class/publicVarProtectedSet.kt"); + } + + @TestMetadata("publicVarPublicSet.kt") + public void testPublicVarPublicSet() { + runTest("compiler/testData/writeFlags/property/classObject/class/publicVarPublicSet.kt"); + } + } + + @TestMetadata("compiler/testData/writeFlags/property/classObject/rename") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Rename extends AbstractFirPsiWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInRename() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/property/classObject/rename"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("constructorAndClassObject.kt") + public void testConstructorAndClassObject() { + runTest("compiler/testData/writeFlags/property/classObject/rename/constructorAndClassObject.kt"); + } + + @TestMetadata("delegatedAndDelegated.kt") + public void testDelegatedAndDelegated() { + runTest("compiler/testData/writeFlags/property/classObject/rename/delegatedAndDelegated.kt"); + } + + @TestMetadata("delegatedAndProperty.kt") + public void testDelegatedAndProperty() { + runTest("compiler/testData/writeFlags/property/classObject/rename/delegatedAndProperty.kt"); + } + + @TestMetadata("propertyAndProperty.kt") + public void testPropertyAndProperty() { + runTest("compiler/testData/writeFlags/property/classObject/rename/propertyAndProperty.kt"); + } + } + + @TestMetadata("compiler/testData/writeFlags/property/classObject/trait") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Trait extends AbstractFirPsiWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInTrait() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/property/classObject/trait"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("delegatedProtectedVar.kt") + public void testDelegatedProtectedVar() { + runTest("compiler/testData/writeFlags/property/classObject/trait/delegatedProtectedVar.kt"); + } + + @TestMetadata("delegatedPublicVal.kt") + public void testDelegatedPublicVal() { + runTest("compiler/testData/writeFlags/property/classObject/trait/delegatedPublicVal.kt"); + } + + @TestMetadata("internalConstVal.kt") + public void testInternalConstVal() { + runTest("compiler/testData/writeFlags/property/classObject/trait/internalConstVal.kt"); + } + + @TestMetadata("internalVal.kt") + public void testInternalVal() { + runTest("compiler/testData/writeFlags/property/classObject/trait/internalVal.kt"); + } + + @TestMetadata("internalVar.kt") + public void testInternalVar() { + runTest("compiler/testData/writeFlags/property/classObject/trait/internalVar.kt"); + } + + @TestMetadata("internalVarPrivateSet.kt") + public void testInternalVarPrivateSet() { + runTest("compiler/testData/writeFlags/property/classObject/trait/internalVarPrivateSet.kt"); + } + + @TestMetadata("noBackingField.kt") + public void testNoBackingField() { + runTest("compiler/testData/writeFlags/property/classObject/trait/noBackingField.kt"); + } + + @TestMetadata("privateConstVal.kt") + public void testPrivateConstVal() { + runTest("compiler/testData/writeFlags/property/classObject/trait/privateConstVal.kt"); + } + + @TestMetadata("privateVal.kt") + public void testPrivateVal() { + runTest("compiler/testData/writeFlags/property/classObject/trait/privateVal.kt"); + } + + @TestMetadata("privateVar.kt") + public void testPrivateVar() { + runTest("compiler/testData/writeFlags/property/classObject/trait/privateVar.kt"); + } + + @TestMetadata("protectedConstVal.kt") + public void testProtectedConstVal() { + runTest("compiler/testData/writeFlags/property/classObject/trait/protectedConstVal.kt"); + } + + @TestMetadata("protectedVal.kt") + public void testProtectedVal() { + runTest("compiler/testData/writeFlags/property/classObject/trait/protectedVal.kt"); + } + + @TestMetadata("protectedVarPrivateSet.kt") + public void testProtectedVarPrivateSet() { + runTest("compiler/testData/writeFlags/property/classObject/trait/protectedVarPrivateSet.kt"); + } + + @TestMetadata("publicConstVal.kt") + public void testPublicConstVal() { + runTest("compiler/testData/writeFlags/property/classObject/trait/publicConstVal.kt"); + } + + @TestMetadata("publicVal.kt") + public void testPublicVal() { + runTest("compiler/testData/writeFlags/property/classObject/trait/publicVal.kt"); + } + + @TestMetadata("publicValNonDefault.kt") + public void testPublicValNonDefault() { + runTest("compiler/testData/writeFlags/property/classObject/trait/publicValNonDefault.kt"); + } + + @TestMetadata("publicVar.kt") + public void testPublicVar() { + runTest("compiler/testData/writeFlags/property/classObject/trait/publicVar.kt"); + } + + @TestMetadata("publicVarNonDefault.kt") + public void testPublicVarNonDefault() { + runTest("compiler/testData/writeFlags/property/classObject/trait/publicVarNonDefault.kt"); + } + + @TestMetadata("publicVarPrivateSet.kt") + public void testPublicVarPrivateSet() { + runTest("compiler/testData/writeFlags/property/classObject/trait/publicVarPrivateSet.kt"); + } + + @TestMetadata("publicVarProtectedSet.kt") + public void testPublicVarProtectedSet() { + runTest("compiler/testData/writeFlags/property/classObject/trait/publicVarProtectedSet.kt"); + } + + @TestMetadata("publicVarPublicSet.kt") + public void testPublicVarPublicSet() { + runTest("compiler/testData/writeFlags/property/classObject/trait/publicVarPublicSet.kt"); + } + } + } + + @TestMetadata("compiler/testData/writeFlags/property/deprecatedFlag") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class DeprecatedFlag extends AbstractFirPsiWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInDeprecatedFlag() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/property/deprecatedFlag"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("propertyInClass.kt") + public void testPropertyInClass() { + runTest("compiler/testData/writeFlags/property/deprecatedFlag/propertyInClass.kt"); + } + + @TestMetadata("topLevelProperty.kt") + public void testTopLevelProperty() { + runTest("compiler/testData/writeFlags/property/deprecatedFlag/topLevelProperty.kt"); + } + } + + @TestMetadata("compiler/testData/writeFlags/property/syntheticAnnotationsMethod") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class SyntheticAnnotationsMethod extends AbstractFirPsiWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInSyntheticAnnotationsMethod() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/property/syntheticAnnotationsMethod"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("doNotUseGetterName.kt") + public void testDoNotUseGetterName() { + runTest("compiler/testData/writeFlags/property/syntheticAnnotationsMethod/doNotUseGetterName.kt"); + } + + @TestMetadata("privateProperty.kt") + public void testPrivateProperty() { + runTest("compiler/testData/writeFlags/property/syntheticAnnotationsMethod/privateProperty.kt"); + } + + @TestMetadata("protectedProperty.kt") + public void testProtectedProperty() { + runTest("compiler/testData/writeFlags/property/syntheticAnnotationsMethod/protectedProperty.kt"); + } + + @TestMetadata("publicProperty.kt") + public void testPublicProperty() { + runTest("compiler/testData/writeFlags/property/syntheticAnnotationsMethod/publicProperty.kt"); + } + + @TestMetadata("withGetterJvmName.kt") + public void testWithGetterJvmName() { + runTest("compiler/testData/writeFlags/property/syntheticAnnotationsMethod/withGetterJvmName.kt"); + } + } + + @TestMetadata("compiler/testData/writeFlags/property/visibility") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Visibility extends AbstractFirPsiWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInVisibility() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/property/visibility"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("internal.kt") + public void testInternal() { + runTest("compiler/testData/writeFlags/property/visibility/internal.kt"); + } + + @TestMetadata("private.kt") + public void testPrivate() { + runTest("compiler/testData/writeFlags/property/visibility/private.kt"); + } + + @TestMetadata("public.kt") + public void testPublic() { + runTest("compiler/testData/writeFlags/property/visibility/public.kt"); + } + } + } + + @TestMetadata("compiler/testData/writeFlags/typealias") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Typealias extends AbstractFirPsiWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInTypealias() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/typealias"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("compiler/testData/writeFlags/typealias/syntheticAnnotationsMethod") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class SyntheticAnnotationsMethod extends AbstractFirPsiWriteFlagsTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInSyntheticAnnotationsMethod() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeFlags/typealias/syntheticAnnotationsMethod"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("privateTypealias.kt") + public void testPrivateTypealias() { + runTest("compiler/testData/writeFlags/typealias/syntheticAnnotationsMethod/privateTypealias.kt"); + } + + @TestMetadata("publicTypealias.kt") + public void testPublicTypealias() { + runTest("compiler/testData/writeFlags/typealias/syntheticAnnotationsMethod/publicTypealias.kt"); + } + } + } +} diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/fir/FirPsiWriteSignatureTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/fir/FirPsiWriteSignatureTestGenerated.java new file mode 100644 index 00000000000..24d5707c621 --- /dev/null +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/fir/FirPsiWriteSignatureTestGenerated.java @@ -0,0 +1,683 @@ +/* + * Copyright 2010-2024 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.codegen.fir; + +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 java.io.File; +import java.util.regex.Pattern; + +/** This class is generated by {@link org.jetbrains.kotlin.test.generators.GenerateCompilerTestsKt}. DO NOT MODIFY MANUALLY */ +@SuppressWarnings("all") +@TestMetadata("compiler/testData/writeSignature") +@TestDataPath("$PROJECT_ROOT") +@RunWith(JUnit3RunnerWithInners.class) +public class FirPsiWriteSignatureTestGenerated extends AbstractFirPsiWriteSignatureTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInWriteSignature() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeSignature"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("ArrayOfCharSequence.kt") + public void testArrayOfCharSequence() { + runTest("compiler/testData/writeSignature/ArrayOfCharSequence.kt"); + } + + @TestMetadata("ArrayOfInt.kt") + public void testArrayOfInt() { + runTest("compiler/testData/writeSignature/ArrayOfInt.kt"); + } + + @TestMetadata("backingFieldForGenericDelegated.kt") + public void testBackingFieldForGenericDelegated() { + runTest("compiler/testData/writeSignature/backingFieldForGenericDelegated.kt"); + } + + @TestMetadata("Comparable.kt") + public void testComparable() { + runTest("compiler/testData/writeSignature/Comparable.kt"); + } + + @TestMetadata("DeepGenericInnerClass.kt") + public void testDeepGenericInnerClass() { + runTest("compiler/testData/writeSignature/DeepGenericInnerClass.kt"); + } + + @TestMetadata("GenericInnerClass.kt") + public void testGenericInnerClass() { + runTest("compiler/testData/writeSignature/GenericInnerClass.kt"); + } + + @TestMetadata("GenericInnerClassWithSimpleOuter.kt") + public void testGenericInnerClassWithSimpleOuter() { + runTest("compiler/testData/writeSignature/GenericInnerClassWithSimpleOuter.kt"); + } + + @TestMetadata("Int.kt") + public void testInt() { + runTest("compiler/testData/writeSignature/Int.kt"); + } + + @TestMetadata("IntArray.kt") + public void testIntArray() { + runTest("compiler/testData/writeSignature/IntArray.kt"); + } + + @TestMetadata("IntQ.kt") + public void testIntQ() { + runTest("compiler/testData/writeSignature/IntQ.kt"); + } + + @TestMetadata("jlString.kt") + public void testJlString() { + runTest("compiler/testData/writeSignature/jlString.kt"); + } + + @TestMetadata("ListOfCharSequence.kt") + public void testListOfCharSequence() { + runTest("compiler/testData/writeSignature/ListOfCharSequence.kt"); + } + + @TestMetadata("ListOfStar.kt") + public void testListOfStar() { + runTest("compiler/testData/writeSignature/ListOfStar.kt"); + } + + @TestMetadata("MapEntry.kt") + public void testMapEntry() { + runTest("compiler/testData/writeSignature/MapEntry.kt"); + } + + @TestMetadata("MutableMapEntry.kt") + public void testMutableMapEntry() { + runTest("compiler/testData/writeSignature/MutableMapEntry.kt"); + } + + @TestMetadata("NonGeneric.kt") + public void testNonGeneric() { + runTest("compiler/testData/writeSignature/NonGeneric.kt"); + } + + @TestMetadata("StarProjectionInClass.kt") + public void testStarProjectionInClass() { + runTest("compiler/testData/writeSignature/StarProjectionInClass.kt"); + } + + @TestMetadata("StarProjectionInSuper.kt") + public void testStarProjectionInSuper() { + runTest("compiler/testData/writeSignature/StarProjectionInSuper.kt"); + } + + @TestMetadata("StarProjectionOutsideClass.kt") + public void testStarProjectionOutsideClass() { + runTest("compiler/testData/writeSignature/StarProjectionOutsideClass.kt"); + } + + @TestMetadata("syntheticAccessorForGeneric.kt") + public void testSyntheticAccessorForGeneric() { + runTest("compiler/testData/writeSignature/syntheticAccessorForGeneric.kt"); + } + + @TestMetadata("VarargCharSequence.kt") + public void testVarargCharSequence() { + runTest("compiler/testData/writeSignature/VarargCharSequence.kt"); + } + + @TestMetadata("VarargGeneric.kt") + public void testVarargGeneric() { + runTest("compiler/testData/writeSignature/VarargGeneric.kt"); + } + + @TestMetadata("compiler/testData/writeSignature/annotations") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Annotations extends AbstractFirPsiWriteSignatureTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInAnnotations() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeSignature/annotations"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("kArrayClassOfJClass.kt") + public void testKArrayClassOfJClass() { + runTest("compiler/testData/writeSignature/annotations/kArrayClassOfJClass.kt"); + } + + @TestMetadata("kArrayClassOfKClass.kt") + public void testKArrayClassOfKClass() { + runTest("compiler/testData/writeSignature/annotations/kArrayClassOfKClass.kt"); + } + + @TestMetadata("kClassBasic.kt") + public void testKClassBasic() { + runTest("compiler/testData/writeSignature/annotations/kClassBasic.kt"); + } + + @TestMetadata("kClassInt.kt") + public void testKClassInt() { + runTest("compiler/testData/writeSignature/annotations/kClassInt.kt"); + } + + @TestMetadata("kClassOfKClass.kt") + public void testKClassOfKClass() { + runTest("compiler/testData/writeSignature/annotations/kClassOfKClass.kt"); + } + } + + @TestMetadata("compiler/testData/writeSignature/callableReference") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class CallableReference extends AbstractFirPsiWriteSignatureTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInCallableReference() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeSignature/callableReference"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("constructorReferenceInReturnType.kt") + public void testConstructorReferenceInReturnType() { + runTest("compiler/testData/writeSignature/callableReference/constructorReferenceInReturnType.kt"); + } + + @TestMetadata("functionReferenceInvoke.kt") + public void testFunctionReferenceInvoke() { + runTest("compiler/testData/writeSignature/callableReference/functionReferenceInvoke.kt"); + } + + @TestMetadata("propertyReferenceGet.kt") + public void testPropertyReferenceGet() { + runTest("compiler/testData/writeSignature/callableReference/propertyReferenceGet.kt"); + } + + @TestMetadata("suspendFunctionReference.kt") + public void testSuspendFunctionReference() { + runTest("compiler/testData/writeSignature/callableReference/suspendFunctionReference.kt"); + } + } + + @TestMetadata("compiler/testData/writeSignature/constructor") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Constructor extends AbstractFirPsiWriteSignatureTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInConstructor() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeSignature/constructor"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("Constructor0.kt") + public void testConstructor0() { + runTest("compiler/testData/writeSignature/constructor/Constructor0.kt"); + } + + @TestMetadata("ConstructorCollectionParameter.kt") + public void testConstructorCollectionParameter() { + runTest("compiler/testData/writeSignature/constructor/ConstructorCollectionParameter.kt"); + } + + @TestMetadata("ConstructorWithTypeParameter.kt") + public void testConstructorWithTypeParameter() { + runTest("compiler/testData/writeSignature/constructor/ConstructorWithTypeParameter.kt"); + } + + @TestMetadata("ConstructorWithTypeParameterAndValueParameterP.kt") + public void testConstructorWithTypeParameterAndValueParameterP() { + runTest("compiler/testData/writeSignature/constructor/ConstructorWithTypeParameterAndValueParameterP.kt"); + } + } + + @TestMetadata("compiler/testData/writeSignature/declarationSiteVariance") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class DeclarationSiteVariance extends AbstractFirPsiWriteSignatureTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInDeclarationSiteVariance() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeSignature/declarationSiteVariance"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("FunctionTwoTypeParameters.kt") + public void testFunctionTwoTypeParameters() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/FunctionTwoTypeParameters.kt"); + } + + @TestMetadata("GenericOverrides.kt") + public void testGenericOverrides() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/GenericOverrides.kt"); + } + + @TestMetadata("InInInPosition.kt") + public void testInInInPosition() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/InInInPosition.kt"); + } + + @TestMetadata("InInOutPosition.kt") + public void testInInOutPosition() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/InInOutPosition.kt"); + } + + @TestMetadata("InOfInInInPosition.kt") + public void testInOfInInInPosition() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/InOfInInInPosition.kt"); + } + + @TestMetadata("InOfInInOutPosition.kt") + public void testInOfInInOutPosition() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/InOfInInOutPosition.kt"); + } + + @TestMetadata("InOfOutInInPosition.kt") + public void testInOfOutInInPosition() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/InOfOutInInPosition.kt"); + } + + @TestMetadata("InOfOutInOutPosition.kt") + public void testInOfOutInOutPosition() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/InOfOutInOutPosition.kt"); + } + + @TestMetadata("MappedSupertypeWithVariance.kt") + public void testMappedSupertypeWithVariance() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/MappedSupertypeWithVariance.kt"); + } + + @TestMetadata("OpenMembersReturnType.kt") + public void testOpenMembersReturnType() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/OpenMembersReturnType.kt"); + } + + @TestMetadata("OpenMembersValueParameter.kt") + public void testOpenMembersValueParameter() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/OpenMembersValueParameter.kt"); + } + + @TestMetadata("OutInField.kt") + public void testOutInField() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/OutInField.kt"); + } + + @TestMetadata("OutInInPosition.kt") + public void testOutInInPosition() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/OutInInPosition.kt"); + } + + @TestMetadata("OutInOutPosition.kt") + public void testOutInOutPosition() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/OutInOutPosition.kt"); + } + + @TestMetadata("OutOfInInInPosition.kt") + public void testOutOfInInInPosition() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/OutOfInInInPosition.kt"); + } + + @TestMetadata("OutOfInInOutPosition.kt") + public void testOutOfInInOutPosition() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/OutOfInInOutPosition.kt"); + } + + @TestMetadata("OutOfOutInInPosition.kt") + public void testOutOfOutInInPosition() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/OutOfOutInInPosition.kt"); + } + + @TestMetadata("OutOfOutInOutPosition.kt") + public void testOutOfOutInOutPosition() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/OutOfOutInOutPosition.kt"); + } + + @TestMetadata("PropertyGetterIn.kt") + public void testPropertyGetterIn() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/PropertyGetterIn.kt"); + } + + @TestMetadata("PropertyGetterOut.kt") + public void testPropertyGetterOut() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/PropertyGetterOut.kt"); + } + + @TestMetadata("PropertyGetterTwoParams.kt") + public void testPropertyGetterTwoParams() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/PropertyGetterTwoParams.kt"); + } + + @TestMetadata("PropertySetterIn.kt") + public void testPropertySetterIn() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/PropertySetterIn.kt"); + } + + @TestMetadata("PropertySetterOut.kt") + public void testPropertySetterOut() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/PropertySetterOut.kt"); + } + + @TestMetadata("RedundantProjections.kt") + public void testRedundantProjections() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/RedundantProjections.kt"); + } + + @TestMetadata("SuperClassWithVariance.kt") + public void testSuperClassWithVariance() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/SuperClassWithVariance.kt"); + } + + @TestMetadata("SuperTraitWithVariance.kt") + public void testSuperTraitWithVariance() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/SuperTraitWithVariance.kt"); + } + + @TestMetadata("SuperTypeWithVarianceInArguments.kt") + public void testSuperTypeWithVarianceInArguments() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/SuperTypeWithVarianceInArguments.kt"); + } + + @TestMetadata("compiler/testData/writeSignature/declarationSiteVariance/jvmWildcardAnnotations") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class JvmWildcardAnnotations extends AbstractFirPsiWriteSignatureTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInJvmWildcardAnnotations() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeSignature/declarationSiteVariance/jvmWildcardAnnotations"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("onFunction.kt") + public void testOnFunction() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/jvmWildcardAnnotations/onFunction.kt"); + } + + @TestMetadata("onTypes.kt") + public void testOnTypes() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/jvmWildcardAnnotations/onTypes.kt"); + } + + @TestMetadata("primitiveTypes.kt") + public void testPrimitiveTypes() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/jvmWildcardAnnotations/primitiveTypes.kt"); + } + } + + @TestMetadata("compiler/testData/writeSignature/declarationSiteVariance/wildcardOptimization") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class WildcardOptimization extends AbstractFirPsiWriteSignatureTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInWildcardOptimization() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeSignature/declarationSiteVariance/wildcardOptimization"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("argumentOverridability.kt") + public void testArgumentOverridability() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/wildcardOptimization/argumentOverridability.kt"); + } + + @TestMetadata("arrays.kt") + public void testArrays() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/wildcardOptimization/arrays.kt"); + } + + @TestMetadata("complicatedInBounds.kt") + public void testComplicatedInBounds() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/wildcardOptimization/complicatedInBounds.kt"); + } + + @TestMetadata("deepOut.kt") + public void testDeepOut() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/wildcardOptimization/deepOut.kt"); + } + + @TestMetadata("fields.kt") + public void testFields() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/wildcardOptimization/fields.kt"); + } + + @TestMetadata("finalReturnType.kt") + public void testFinalReturnType() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/wildcardOptimization/finalReturnType.kt"); + } + + @TestMetadata("outIn.kt") + public void testOutIn() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/wildcardOptimization/outIn.kt"); + } + + @TestMetadata("outInv.kt") + public void testOutInv() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/wildcardOptimization/outInv.kt"); + } + + @TestMetadata("topLevelIn.kt") + public void testTopLevelIn() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/wildcardOptimization/topLevelIn.kt"); + } + + @TestMetadata("topLevelInv.kt") + public void testTopLevelInv() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/wildcardOptimization/topLevelInv.kt"); + } + + @TestMetadata("typeParameter.kt") + public void testTypeParameter() { + runTest("compiler/testData/writeSignature/declarationSiteVariance/wildcardOptimization/typeParameter.kt"); + } + } + } + + @TestMetadata("compiler/testData/writeSignature/defaultImpls") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class DefaultImpls extends AbstractFirPsiWriteSignatureTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInDefaultImpls() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeSignature/defaultImpls"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("functionTypeParameterClash.kt") + public void testFunctionTypeParameterClash() { + runTest("compiler/testData/writeSignature/defaultImpls/functionTypeParameterClash.kt"); + } + + @TestMetadata("functionTypeParameterClashWith_I.kt") + public void testFunctionTypeParameterClashWith_I() { + runTest("compiler/testData/writeSignature/defaultImpls/functionTypeParameterClashWith_I.kt"); + } + + @TestMetadata("propertyTypeParameterClash.kt") + public void testPropertyTypeParameterClash() { + runTest("compiler/testData/writeSignature/defaultImpls/propertyTypeParameterClash.kt"); + } + } + + @TestMetadata("compiler/testData/writeSignature/inlineClasses") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class InlineClasses extends AbstractFirPsiWriteSignatureTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInInlineClasses() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeSignature/inlineClasses"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("basicInlineClassDeclarationCodegen.kt") + public void testBasicInlineClassDeclarationCodegen() { + runTest("compiler/testData/writeSignature/inlineClasses/basicInlineClassDeclarationCodegen.kt"); + } + + @TestMetadata("genericInlineClassBasedOnGenericType.kt") + public void testGenericInlineClassBasedOnGenericType() { + runTest("compiler/testData/writeSignature/inlineClasses/genericInlineClassBasedOnGenericType.kt"); + } + + @TestMetadata("genericMethodInsideClass.kt") + public void testGenericMethodInsideClass() { + runTest("compiler/testData/writeSignature/inlineClasses/genericMethodInsideClass.kt"); + } + + @TestMetadata("inlineClassAsGenericArgument.kt") + public void testInlineClassAsGenericArgument() { + runTest("compiler/testData/writeSignature/inlineClasses/inlineClassAsGenericArgument.kt"); + } + + @TestMetadata("inlineClassBasedOnOtherInlineClass.kt") + public void testInlineClassBasedOnOtherInlineClass() { + runTest("compiler/testData/writeSignature/inlineClasses/inlineClassBasedOnOtherInlineClass.kt"); + } + + @TestMetadata("inlineClassWithComplexSubstitutedType.kt") + public void testInlineClassWithComplexSubstitutedType() { + runTest("compiler/testData/writeSignature/inlineClasses/inlineClassWithComplexSubstitutedType.kt"); + } + + @TestMetadata("inlineClassesInsideFunctionalTypes.kt") + public void testInlineClassesInsideFunctionalTypes() { + runTest("compiler/testData/writeSignature/inlineClasses/inlineClassesInsideFunctionalTypes.kt"); + } + + @TestMetadata("nullableInlineClassType.kt") + public void testNullableInlineClassType() { + runTest("compiler/testData/writeSignature/inlineClasses/nullableInlineClassType.kt"); + } + + @TestMetadata("simpleSignatureWithInlineClassTypesAsPrimitive.kt") + public void testSimpleSignatureWithInlineClassTypesAsPrimitive() { + runTest("compiler/testData/writeSignature/inlineClasses/simpleSignatureWithInlineClassTypesAsPrimitive.kt"); + } + + @TestMetadata("simpleSignatureWithInlineClassTypesAsReference.kt") + public void testSimpleSignatureWithInlineClassTypesAsReference() { + runTest("compiler/testData/writeSignature/inlineClasses/simpleSignatureWithInlineClassTypesAsReference.kt"); + } + } + + @TestMetadata("compiler/testData/writeSignature/java8") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Java8 extends AbstractFirPsiWriteSignatureTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInJava8() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeSignature/java8"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("mutableMapRemove.kt") + public void testMutableMapRemove() { + runTest("compiler/testData/writeSignature/java8/mutableMapRemove.kt"); + } + } + + @TestMetadata("compiler/testData/writeSignature/nothing") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Nothing extends AbstractFirPsiWriteSignatureTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInNothing() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeSignature/nothing"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("nothing.kt") + public void testNothing() { + runTest("compiler/testData/writeSignature/nothing/nothing.kt"); + } + + @TestMetadata("nullableNothing.kt") + public void testNullableNothing() { + runTest("compiler/testData/writeSignature/nothing/nullableNothing.kt"); + } + } + + @TestMetadata("compiler/testData/writeSignature/parameterlessMain") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class ParameterlessMain extends AbstractFirPsiWriteSignatureTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInParameterlessMain() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeSignature/parameterlessMain"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("arrayWithContravariantStringIsNotMainMethod.kt") + public void testArrayWithContravariantStringIsNotMainMethod() { + runTest("compiler/testData/writeSignature/parameterlessMain/arrayWithContravariantStringIsNotMainMethod.kt"); + } + + @TestMetadata("impostorMains.kt") + public void testImpostorMains() { + runTest("compiler/testData/writeSignature/parameterlessMain/impostorMains.kt"); + } + + @TestMetadata("main.kt") + public void testMain() { + runTest("compiler/testData/writeSignature/parameterlessMain/main.kt"); + } + + @TestMetadata("notJvmMainName.kt") + public void testNotJvmMainName() { + runTest("compiler/testData/writeSignature/parameterlessMain/notJvmMainName.kt"); + } + + @TestMetadata("simple.kt") + public void testSimple() { + runTest("compiler/testData/writeSignature/parameterlessMain/simple.kt"); + } + } + + @TestMetadata("compiler/testData/writeSignature/suspendMain") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class SuspendMain extends AbstractFirPsiWriteSignatureTest { + private void runTest(String testDataFilePath) { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInSuspendMain() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/writeSignature/suspendMain"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("parameterlessSuspendMain.kt") + public void testParameterlessSuspendMain() { + runTest("compiler/testData/writeSignature/suspendMain/parameterlessSuspendMain.kt"); + } + + @TestMetadata("suspendMain.kt") + public void testSuspendMain() { + runTest("compiler/testData/writeSignature/suspendMain/suspendMain.kt"); + } + } +} diff --git a/compiler/tests-gen/org/jetbrains/kotlin/jvm/compiler/ir/FirLightTreeCompileJavaAgainstKotlinTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/jvm/compiler/fir/FirLightTreeCompileJavaAgainstKotlinTestGenerated.java similarity index 99% rename from compiler/tests-gen/org/jetbrains/kotlin/jvm/compiler/ir/FirLightTreeCompileJavaAgainstKotlinTestGenerated.java rename to compiler/tests-gen/org/jetbrains/kotlin/jvm/compiler/fir/FirLightTreeCompileJavaAgainstKotlinTestGenerated.java index 236f2089ac2..3e57fec56a5 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/jvm/compiler/ir/FirLightTreeCompileJavaAgainstKotlinTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/jvm/compiler/fir/FirLightTreeCompileJavaAgainstKotlinTestGenerated.java @@ -3,7 +3,7 @@ * 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.jvm.compiler.ir; +package org.jetbrains.kotlin.jvm.compiler.fir; import com.intellij.testFramework.TestDataPath; import org.jetbrains.kotlin.test.JUnit3RunnerWithInners; diff --git a/compiler/tests-gen/org/jetbrains/kotlin/jvm/compiler/ir/FirPsiCompileJavaAgainstKotlinTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/jvm/compiler/fir/FirPsiCompileJavaAgainstKotlinTestGenerated.java similarity index 99% rename from compiler/tests-gen/org/jetbrains/kotlin/jvm/compiler/ir/FirPsiCompileJavaAgainstKotlinTestGenerated.java rename to compiler/tests-gen/org/jetbrains/kotlin/jvm/compiler/fir/FirPsiCompileJavaAgainstKotlinTestGenerated.java index 9c72ea60c3e..bcd34f33c20 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/jvm/compiler/ir/FirPsiCompileJavaAgainstKotlinTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/jvm/compiler/fir/FirPsiCompileJavaAgainstKotlinTestGenerated.java @@ -3,7 +3,7 @@ * 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.jvm.compiler.ir; +package org.jetbrains.kotlin.jvm.compiler.fir; import com.intellij.testFramework.TestDataPath; import org.jetbrains.kotlin.test.JUnit3RunnerWithInners; diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/AbstractCustomScriptCodegenTest.kt b/compiler/tests/org/jetbrains/kotlin/codegen/AbstractCustomScriptCodegenTest.kt index c69f8dda366..e35c6cbf448 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/AbstractCustomScriptCodegenTest.kt +++ b/compiler/tests/org/jetbrains/kotlin/codegen/AbstractCustomScriptCodegenTest.kt @@ -136,7 +136,8 @@ abstract class AbstractCustomScriptCodegenTest : CodegenTestCase() { } abstract class AbstractIrCustomScriptCodegenTest : AbstractCustomScriptCodegenTest() { - override val backend: TargetBackend = TargetBackend.JVM_IR + override val backend: TargetBackend + get() = TargetBackend.JVM_IR } object TestScriptWithReceiversConfiguration : ScriptCompilationConfiguration( diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/ControlStructuresTest.java b/compiler/tests/org/jetbrains/kotlin/codegen/ControlStructuresTest.java index 82097a9686d..3856e1b0c53 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/ControlStructuresTest.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/ControlStructuresTest.java @@ -82,7 +82,7 @@ public class ControlStructuresTest extends CodegenTestCase { public void testCompareToNonnullableNotEq() throws Exception { loadText("fun foo(a: String?, b: String): Boolean = a != b"); String text = generateToText(); - assertTrue(text.contains("IXOR")); + assertTrue(text, text.contains("IXOR")); Method main = generateFunction(); assertEquals(true, main.invoke(null, null, "lala")); assertEquals(false, main.invoke(null, "papa", "papa")); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/CustomBytecodeTextTest.kt b/compiler/tests/org/jetbrains/kotlin/codegen/CustomBytecodeTextTest.kt index 652f7b4a37f..45a25edc32f 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/CustomBytecodeTextTest.kt +++ b/compiler/tests/org/jetbrains/kotlin/codegen/CustomBytecodeTextTest.kt @@ -21,8 +21,8 @@ import org.jetbrains.kotlin.test.ConfigurationKind import org.jetbrains.kotlin.test.testFramework.KtUsefulTestCase @OptIn(ObsoleteTestInfrastructure::class) -class CustomBytecodeTextTest : AbstractBytecodeTextTest() { - fun testEnumMapping() { +open class CustomBytecodeTextTest : AbstractBytecodeTextTest() { + open fun testEnumMapping() { createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.ALL) myFiles = CodegenTestFiles.create( "whenMappingOrder.kt", @@ -46,13 +46,13 @@ class CustomBytecodeTextTest : AbstractBytecodeTextTest() { val text = generateToText() val getstatics = text.lines().filter { it.contains("GETSTATIC MyEnum.") }.map { it.trim() } KtUsefulTestCase.assertOrderedEquals( - "actual bytecode:\n$text", listOf( + "actual bytecode:\n$text", getstatics, listOf( "GETSTATIC MyEnum.${'$'}VALUES : [LMyEnum;", "GETSTATIC MyEnum.ENTRY4 : LMyEnum;", "GETSTATIC MyEnum.ENTRY3 : LMyEnum;", "GETSTATIC MyEnum.ENTRY2 : LMyEnum;", "GETSTATIC MyEnum.ENTRY1 : LMyEnum;" - ), getstatics + ) ) } } diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/CustomScriptCodegenTest.kt b/compiler/tests/org/jetbrains/kotlin/codegen/CustomScriptCodegenTest.kt index 83b654f3cb1..16fc7b40163 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/CustomScriptCodegenTest.kt +++ b/compiler/tests/org/jetbrains/kotlin/codegen/CustomScriptCodegenTest.kt @@ -25,9 +25,8 @@ import kotlin.script.experimental.annotations.KotlinScript import kotlin.script.experimental.jvm.defaultJvmScriptingHostConfiguration import kotlin.script.experimental.jvm.util.scriptCompilationClasspathFromContextOrStdlib -class CustomScriptCodegenTest : CodegenTestCase() { - - fun testAnnotatedDefinition() { +open class CustomScriptCodegenTest : CodegenTestCase() { + open fun testAnnotatedDefinition() { createScriptTestEnvironment("org.jetbrains.kotlin.codegen.TestScriptWithAnnotatedBaseClass") loadScript("val x = 1") val res = generateScriptClass() @@ -42,6 +41,9 @@ class CustomScriptCodegenTest : CodegenTestCase() { myFiles = CodegenTestFiles.create("scriptTest.kts", text, myEnvironment.project) } + override val backend: TargetBackend + get() = TargetBackend.JVM + private fun createScriptTestEnvironment(vararg scriptDefinitions: String) { if (myEnvironment != null) { throw IllegalStateException("must not set up myEnvironment twice") @@ -60,7 +62,6 @@ class CustomScriptCodegenTest : CodegenTestCase() { val configuration = createConfiguration( ConfigurationKind.ALL, TestJdkKind.MOCK_JDK, - TargetBackend.JVM, additionalDependencies, emptyList(), emptyList() diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/GenerateNotNullAssertionsTest.java b/compiler/tests/org/jetbrains/kotlin/codegen/GenerateNotNullAssertionsTest.java deleted file mode 100644 index d05131d0137..00000000000 --- a/compiler/tests/org/jetbrains/kotlin/codegen/GenerateNotNullAssertionsTest.java +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Copyright 2010-2019 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.codegen; - -public class GenerateNotNullAssertionsTest extends AbstractGenerateNotNullAssertionsTest { - public void testNoAssertionsForKotlinFromBinary() { - doTestNoAssertionsForKotlinFromBinary("noAssertionsForKotlin.kt", "noAssertionsForKotlinMain.kt"); - } -} diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/MethodOrderTest.kt b/compiler/tests/org/jetbrains/kotlin/codegen/MethodOrderTest.kt index 204abc10b1f..4e61bbd495f 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/MethodOrderTest.kt +++ b/compiler/tests/org/jetbrains/kotlin/codegen/MethodOrderTest.kt @@ -24,8 +24,8 @@ import org.jetbrains.org.objectweb.asm.MethodVisitor import org.jetbrains.org.objectweb.asm.Opcodes import java.util.* -class MethodOrderTest : CodegenTestCase() { - fun testDelegatedMethod() { +open class MethodOrderTest : CodegenTestCase() { + open fun testDelegatedMethod() { doTest( """ interface Trait { @@ -48,7 +48,7 @@ class MethodOrderTest : CodegenTestCase() { ) } - fun testLambdaClosureOrdering() { + open fun testLambdaClosureOrdering() { doTest( """ class Klass { @@ -66,7 +66,7 @@ class MethodOrderTest : CodegenTestCase() { ) } - fun testAnonymousObjectClosureOrdering() { + open fun testAnonymousObjectClosureOrdering() { doTest( """ class Klass { @@ -84,7 +84,7 @@ class MethodOrderTest : CodegenTestCase() { ) } - fun testMemberAccessor() { + open fun testMemberAccessor() { doTest( """ class Outer(private val a: Int, private var b: String) { @@ -111,7 +111,7 @@ class MethodOrderTest : CodegenTestCase() { ) } - fun testDeterministicDefaultMethodImplOrder() { + open fun testDeterministicDefaultMethodImplOrder() { doTest( """ interface Base { @@ -147,7 +147,7 @@ class MethodOrderTest : CodegenTestCase() { ) } - fun testBridgeOrder() { + open fun testBridgeOrder() { doTest( """ interface IrElement @@ -174,11 +174,12 @@ class MethodOrderTest : CodegenTestCase() { ) } - private fun doTest(sourceText: String, classSuffix: String, expectedOrder: List) { + protected fun doTest(sourceText: String, classSuffix: String, expectedOrder: List) { createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY) myFiles = CodegenTestFiles.create("file.kt", sourceText, myEnvironment!!.project) - val classFileForObject = generateClassesInFile().asList().first { it.relativePath.endsWith("$classSuffix.class") } + val classFileForObject = generateClassesInFile().asList().firstOrNull { it.relativePath.endsWith("$classSuffix.class") } + checkNotNull(classFileForObject) { "class ending on $classSuffix was not generated" } val classReader = ClassReader(classFileForObject.asByteArray()) val methodNames = ArrayList() diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/ReflectionClassLoaderTest.kt b/compiler/tests/org/jetbrains/kotlin/codegen/ReflectionClassLoaderTest.kt index 9a6d0ecdfe8..5582bc7a31d 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/ReflectionClassLoaderTest.kt +++ b/compiler/tests/org/jetbrains/kotlin/codegen/ReflectionClassLoaderTest.kt @@ -18,7 +18,7 @@ package org.jetbrains.kotlin.codegen import org.jetbrains.kotlin.test.ConfigurationKind -class ReflectionClassLoaderTest : CodegenTestCase() { +open class ReflectionClassLoaderTest : CodegenTestCase() { override fun getPrefix() = "reflection/classLoaders" override fun setUp() { diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/defaultConstructor/fir/AbstractFirLightTreeDefaultArgumentsReflectionTest.kt b/compiler/tests/org/jetbrains/kotlin/codegen/defaultConstructor/fir/AbstractFirLightTreeDefaultArgumentsReflectionTest.kt new file mode 100644 index 00000000000..2caaa561aea --- /dev/null +++ b/compiler/tests/org/jetbrains/kotlin/codegen/defaultConstructor/fir/AbstractFirLightTreeDefaultArgumentsReflectionTest.kt @@ -0,0 +1,17 @@ +/* + * Copyright 2010-2024 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.codegen.defaultConstructor.fir + +import org.jetbrains.kotlin.codegen.defaultConstructor.ir.AbstractIrDefaultArgumentsReflectionTest +import org.jetbrains.kotlin.test.FirParser + +abstract class AbstractFirLightTreeDefaultArgumentsReflectionTest : AbstractIrDefaultArgumentsReflectionTest() { + override val useFir: Boolean + get() = true + + override val firParser: FirParser + get() = FirParser.LightTree +} \ No newline at end of file diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/defaultConstructor/fir/AbstractFirPsiDefaultArgumentsReflectionTest.kt b/compiler/tests/org/jetbrains/kotlin/codegen/defaultConstructor/fir/AbstractFirPsiDefaultArgumentsReflectionTest.kt new file mode 100644 index 00000000000..a66221995fe --- /dev/null +++ b/compiler/tests/org/jetbrains/kotlin/codegen/defaultConstructor/fir/AbstractFirPsiDefaultArgumentsReflectionTest.kt @@ -0,0 +1,17 @@ +/* + * Copyright 2010-2024 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.codegen.defaultConstructor.fir + +import org.jetbrains.kotlin.codegen.defaultConstructor.ir.AbstractIrDefaultArgumentsReflectionTest +import org.jetbrains.kotlin.test.FirParser + +abstract class AbstractFirPsiDefaultArgumentsReflectionTest : AbstractIrDefaultArgumentsReflectionTest() { + override val useFir: Boolean + get() = true + + override val firParser: FirParser + get() = FirParser.Psi +} diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/defaultConstructor/ir/AbstractIrDefaultArgumentsReflectionTest.kt b/compiler/tests/org/jetbrains/kotlin/codegen/defaultConstructor/ir/AbstractIrDefaultArgumentsReflectionTest.kt new file mode 100644 index 00000000000..87e54021574 --- /dev/null +++ b/compiler/tests/org/jetbrains/kotlin/codegen/defaultConstructor/ir/AbstractIrDefaultArgumentsReflectionTest.kt @@ -0,0 +1,14 @@ +/* + * Copyright 2010-2024 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.codegen.defaultConstructor.ir + +import org.jetbrains.kotlin.codegen.defaultConstructor.AbstractDefaultArgumentsReflectionTest +import org.jetbrains.kotlin.test.TargetBackend + +abstract class AbstractIrDefaultArgumentsReflectionTest : AbstractDefaultArgumentsReflectionTest() { + override val backend: TargetBackend + get() = TargetBackend.JVM_IR +} diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/fir/FirLightTreeCodegenTestCase.kt b/compiler/tests/org/jetbrains/kotlin/codegen/fir/FirLightTreeCodegenTestCase.kt new file mode 100644 index 00000000000..1c36657c1f6 --- /dev/null +++ b/compiler/tests/org/jetbrains/kotlin/codegen/fir/FirLightTreeCodegenTestCase.kt @@ -0,0 +1,172 @@ +/* + * Copyright 2010-2024 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. + */ + +@file:Suppress("JUnitTestCaseWithNoTests") + +package org.jetbrains.kotlin.codegen.fir + +import org.jetbrains.kotlin.codegen.ir.* +import org.jetbrains.kotlin.jvm.compiler.JvmIrLinkageModeTest +import org.jetbrains.kotlin.test.FirParser +import org.jetbrains.kotlin.test.FirParser.LightTree + +class FirLightTreePackageGenTest : IrPackageGenTest() { + override val useFir: Boolean + get() = true + + override val firParser: FirParser + get() = LightTree +} + +class FirLightTreePrimitiveTypesTest : IrPrimitiveTypesTest() { + override val useFir: Boolean + get() = true + + override val firParser: FirParser + get() = LightTree +} + +class FirLightTreeAnnotationGenTest : IrAnnotationGenTest() { + override val useFir: Boolean + get() = true + + override val firParser: FirParser + get() = LightTree +} + +class FirLightTreeOuterClassGenTest : IrOuterClassGenTest() { + override val useFir: Boolean + get() = true + + override val firParser: FirParser + get() = LightTree +} + +abstract class AbstractFirLightTreeCheckLocalVariablesTableTest : AbstractIrCheckLocalVariablesTableTest() { + override val useFir: Boolean + get() = true + + override val firParser: FirParser + get() = LightTree +} + +class FirLightTreePropertyGenTest : IrPropertyGenTest() { + override val useFir: Boolean + get() = true + + override val firParser: FirParser + get() = LightTree +} + +class FirLightTreeKotlinSyntheticClassAnnotationTest : IrKotlinSyntheticClassAnnotationTest() { + override val useFir: Boolean + get() = true + + override val firParser: FirParser + get() = LightTree +} + +class FirLightTreeVarArgTest : IrVarArgTest() { + override val useFir: Boolean + get() = true + + override val firParser: FirParser + get() = LightTree +} + +class FirLightTreeControlStructuresTest : IrControlStructuresTest() { + override val useFir: Boolean + get() = true + + override val firParser: FirParser + get() = LightTree +} + +class FirLightTreeInnerClassInfoGenTest : IrInnerClassInfoGenTest() { + override val useFir: Boolean + get() = true + + override val firParser: FirParser + get() = LightTree +} + +class FirLightTreeMethodOrderTest : IrMethodOrderTest() { + override val useFir: Boolean + get() = true + + override val firParser: FirParser + get() = LightTree + + override fun testDelegatedMethod() { + doTest( + """ + interface Trait { + fun f0() + fun f4() + fun f3() + fun f2() + fun f1() + fun f5() + } + + val delegate: Trait = throw Error() + + val obj = object : Trait by delegate { + override fun f3() { } + } + """, + "\$obj$1", + listOf("()V", "f0()V", "f4()V", "f2()V", "f1()V", "f5()V", "f3()V") + ) + } +} + +class FirLightTreeReflectionClassLoaderTest : IrReflectionClassLoaderTest() { + override val useFir: Boolean + get() = true + + override val firParser: FirParser + get() = LightTree +} + +class FirLightTreeCustomBytecodeTextTest : IrCustomBytecodeTextTest() { + override val useFir: Boolean + get() = true + + override val firParser: FirParser + get() = LightTree +} + +class FirLightTreeCustomScriptCodegenTest : IrCustomScriptCodegenTest() { + override val useFir: Boolean + get() = true + + override val firParser: FirParser + get() = LightTree +} + +class FirLightTreeGenerateNotNullAssertionsTest : IrGenerateNotNullAssertionsTest() { + override val useFir: Boolean + get() = true + + override val firParser: FirParser + get() = LightTree +} + +class FirLightTreeSourceInfoGenTest : IrSourceInfoGenTest() { + override val useFir: Boolean + get() = true + + override val firParser: FirParser + get() = LightTree +} + +class FirLightTreeLinkageModeTest : JvmIrLinkageModeTest() { + override val useFir: Boolean + get() = true + + override val firParser: FirParser + get() = LightTree +} diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/fir/FirPsiCodegenTestCase.kt b/compiler/tests/org/jetbrains/kotlin/codegen/fir/FirPsiCodegenTestCase.kt new file mode 100644 index 00000000000..3960481f53a --- /dev/null +++ b/compiler/tests/org/jetbrains/kotlin/codegen/fir/FirPsiCodegenTestCase.kt @@ -0,0 +1,172 @@ +/* + * Copyright 2010-2024 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. + */ + +@file:Suppress("JUnitTestCaseWithNoTests") + +package org.jetbrains.kotlin.codegen.fir + +import org.jetbrains.kotlin.codegen.ir.* +import org.jetbrains.kotlin.jvm.compiler.JvmIrLinkageModeTest +import org.jetbrains.kotlin.test.FirParser +import org.jetbrains.kotlin.test.FirParser.Psi + +class FirPsiPackageGenTest : IrPackageGenTest() { + override val useFir: Boolean + get() = true + + override val firParser: FirParser + get() = Psi +} + +class FirPsiPrimitiveTypesTest : IrPrimitiveTypesTest() { + override val useFir: Boolean + get() = true + + override val firParser: FirParser + get() = Psi +} + +class FirPsiAnnotationGenTest : IrAnnotationGenTest() { + override val useFir: Boolean + get() = true + + override val firParser: FirParser + get() = Psi +} + +class FirPsiOuterClassGenTest : IrOuterClassGenTest() { + override val useFir: Boolean + get() = true + + override val firParser: FirParser + get() = Psi +} + +abstract class AbstractFirPsiCheckLocalVariablesTableTest : AbstractIrCheckLocalVariablesTableTest() { + override val useFir: Boolean + get() = true + + override val firParser: FirParser + get() = Psi +} + +class FirPsiPropertyGenTest : IrPropertyGenTest() { + override val useFir: Boolean + get() = true + + override val firParser: FirParser + get() = Psi +} + +class FirPsiKotlinSyntheticClassAnnotationTest : IrKotlinSyntheticClassAnnotationTest() { + override val useFir: Boolean + get() = true + + override val firParser: FirParser + get() = Psi +} + +class FirPsiVarArgTest : IrVarArgTest() { + override val useFir: Boolean + get() = true + + override val firParser: FirParser + get() = Psi +} + +class FirPsiControlStructuresTest : IrControlStructuresTest() { + override val useFir: Boolean + get() = true + + override val firParser: FirParser + get() = Psi +} + +class FirPsiInnerClassInfoGenTest : IrInnerClassInfoGenTest() { + override val useFir: Boolean + get() = true + + override val firParser: FirParser + get() = Psi +} + +class FirPsiMethodOrderTest : IrMethodOrderTest() { + override val useFir: Boolean + get() = true + + override val firParser: FirParser + get() = Psi + + override fun testDelegatedMethod() { + doTest( + """ + interface Trait { + fun f0() + fun f4() + fun f3() + fun f2() + fun f1() + fun f5() + } + + val delegate: Trait = throw Error() + + val obj = object : Trait by delegate { + override fun f3() { } + } + """, + "\$obj$1", + listOf("()V", "f0()V", "f4()V", "f2()V", "f1()V", "f5()V", "f3()V") + ) + } +} + +class FirPsiReflectionClassLoaderTest : IrReflectionClassLoaderTest() { + override val useFir: Boolean + get() = true + + override val firParser: FirParser + get() = Psi +} + +class FirPsiCustomBytecodeTextTest : IrCustomBytecodeTextTest() { + override val useFir: Boolean + get() = true + + override val firParser: FirParser + get() = Psi +} + +class FirPsiCustomScriptCodegenTest : IrCustomScriptCodegenTest() { + override val useFir: Boolean + get() = true + + override val firParser: FirParser + get() = Psi +} + +class FirPsiGenerateNotNullAssertionsTest : IrGenerateNotNullAssertionsTest() { + override val useFir: Boolean + get() = true + + override val firParser: FirParser + get() = Psi +} + +class FirPsiSourceInfoGenTest : IrSourceInfoGenTest() { + override val useFir: Boolean + get() = true + + override val firParser: FirParser + get() = Psi +} + +class FirPsiLinkageModeTest : JvmIrLinkageModeTest() { + override val useFir: Boolean + get() = true + + override val firParser: FirParser + get() = Psi +} diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrCodegenTestCase.kt b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrCodegenTestCase.kt new file mode 100644 index 00000000000..b2fd5012389 --- /dev/null +++ b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrCodegenTestCase.kt @@ -0,0 +1,268 @@ +/* + * Copyright 2010-2024 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. + */ + +@file:Suppress("JUnitTestCaseWithNoTests") + +package org.jetbrains.kotlin.codegen.ir + +import org.jetbrains.kotlin.codegen.* +import org.jetbrains.kotlin.config.CompilerConfiguration +import org.jetbrains.kotlin.config.JVMConfigurationKeys +import org.jetbrains.kotlin.config.JvmClosureGenerationScheme +import org.jetbrains.kotlin.test.TargetBackend +import org.jetbrains.kotlin.test.TargetBackend.JVM_IR + +open class IrPackageGenTest : PackageGenTest() { + override val backend: TargetBackend + get() = JVM_IR +} + +open class IrPrimitiveTypesTest : PrimitiveTypesTest() { + override val backend: TargetBackend + get() = JVM_IR +} + +open class IrAnnotationGenTest : AnnotationGenTest() { + override val backend: TargetBackend + get() = JVM_IR +} + +open class IrOuterClassGenTest : OuterClassGenTest() { + override val backend: TargetBackend + get() = JVM_IR + + // Class lambda not generated + + override fun testLambdaInConstructor() { + } + + override fun testLambdaInInlineFunction() { + } + + override fun testLambdaInInlineLambda() { + } + + override fun testLambdaInLambdaInlinedIntoObject() { + } + + override fun testLambdaInLambdaInlinedIntoObject2() { + } + + override fun testLambdaInNoInlineFun() { + } + + override fun testLambdaInlined() { + } + + override fun testLocalObjectInInlineLambda() { + } + + override fun testLocalObjectInLambdaInlinedIntoObject2() { + } +} + +open class IrPropertyGenTest : PropertyGenTest() { + override val backend: TargetBackend + get() = JVM_IR +} + +open class IrKotlinSyntheticClassAnnotationTest : KotlinSyntheticClassAnnotationTest() { + override val backend: TargetBackend + get() = JVM_IR + + override fun updateConfiguration(configuration: CompilerConfiguration) { + // Current tests rely on class lambdas + configuration.put(JVMConfigurationKeys.LAMBDAS, JvmClosureGenerationScheme.CLASS) + configuration.put(JVMConfigurationKeys.SAM_CONVERSIONS, JvmClosureGenerationScheme.CLASS) + super.updateConfiguration(configuration) + } + + override fun testLocalFunction() { + // Indy is generated, irrelevant test + } +} + +open class IrVarArgTest : VarArgTest() { + override val backend: TargetBackend + get() = JVM_IR +} + +open class IrControlStructuresTest : ControlStructuresTest() { + override val backend: TargetBackend + get() = JVM_IR + + override fun testCompareToNonnullableNotEq() { + // https://youtrack.jetbrains.com/issue/KT-65357 + } +} + +open class IrInnerClassInfoGenTest : InnerClassInfoGenTest() { + override val backend: TargetBackend + get() = JVM_IR + + // Test is irrelevant with indy lambdas. + + override fun testLambdaClassFlags() { + } +} + +open class IrMethodOrderTest : MethodOrderTest() { + override val backend: TargetBackend + get() = JVM_IR + + // Test is irrelevant with indy lambdas. + override fun testLambdaClosureOrdering() { + } + + override fun testDelegatedMethod() { + doTest( + """ + interface Trait { + fun f0() + fun f4() + fun f3() + fun f2() + fun f1() + fun f5() + } + + val delegate: Trait = throw Error() + + val obj = object : Trait by delegate { + override fun f3() { } + } + """, + "\$obj$1", + listOf( "()V", "f0()V", "f1()V", "f2()V", "f4()V", "f5()V", "f3()V") + ) + } + + override fun testAnonymousObjectClosureOrdering() { + doTest( + """ + class Klass { + fun Any.f(a: String, b: Int, c: Double, d: Any, e: Long) { + object : Runnable { + override fun run() { + a + b + c + d + e + this@f + this@Klass + } + }.run() + } + } + """, + "\$f$1", + listOf("(Ljava/lang/String;IDLjava/lang/Object;JLjava/lang/Object;LKlass;)V", "run()V") + ) + } + + override fun testBridgeOrder() { + doTest( + """ + interface IrElement + class IrClassContext + + interface IrElementVisitor { + fun visitElement(element: IrElement, data: D): R + } + + interface IrElementTransformer : IrElementVisitor { + override fun visitElement(element: IrElement, data: D): IrElement = + element.also { throw RuntimeException() } + } + + abstract class ClassLowerWithContext : IrElementTransformer + """, + "ClassLowerWithContext", + listOf( + "()V", + "visitElement(LIrElement;LIrClassContext;)LIrElement;", + "visitElement(LIrElement;Ljava/lang/Object;)LIrElement;", + "visitElement(LIrElement;Ljava/lang/Object;)Ljava/lang/Object;", + ) + ) + } + + override fun testMemberAccessor() { + doTest( + """ + class Outer(private val a: Int, private var b: String) { + private fun c() { + } + + inner class Inner() { + init { + b = b + a + c() + } + } + } + """, + "Outer", + listOf( + "(ILjava/lang/String;)V", + "c()V", + "access\$setB\$p(LOuter;Ljava/lang/String;)V", + "access\$getB\$p(LOuter;)Ljava/lang/String;", + "access\$getA\$p(LOuter;)I", + "access\$c(LOuter;)V" + ) + ) + } + + override fun testDeterministicDefaultMethodImplOrder() { + doTest( + """ + interface Base { + fun getSize(): Int = 5 + fun size(): Int = getSize() + fun getKeys(): Int = 4 + fun keySet() = getKeys() + fun getEntries(): Int = 3 + fun entrySet() = getEntries() + fun getValues(): Int = 2 + fun values() = getValues() + + fun removeEldestEntry(eldest: Any?): Boolean + } + + class MinMap : Base { + override fun removeEldestEntry(eldest: Any?) = true + } + """, + "MinMap", + listOf( + "()V", + "removeEldestEntry(Ljava/lang/Object;)Z", + "getSize()I", + "size()I", + "getKeys()I", + "keySet()I", + "getEntries()I", + "entrySet()I", + "getValues()I", + "values()I" + ) + ) + } +} + +open class IrReflectionClassLoaderTest : ReflectionClassLoaderTest() { + override val backend: TargetBackend + get() = JVM_IR +} + +open class IrCustomScriptCodegenTest : CustomScriptCodegenTest() { + override val backend: TargetBackend + get() = JVM_IR + + override fun testAnnotatedDefinition() { + // Discussing + } +} + +open class IrSourceInfoGenTest : SourceInfoGenTest() { + override val backend: TargetBackend + get() = JVM_IR +} diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrCustomBytecodeTextTest.kt b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrCustomBytecodeTextTest.kt new file mode 100644 index 00000000000..f3a18fd69b1 --- /dev/null +++ b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrCustomBytecodeTextTest.kt @@ -0,0 +1,58 @@ +/* + * Copyright 2010-2024 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.codegen.ir + +import org.jetbrains.kotlin.codegen.CodegenTestFiles +import org.jetbrains.kotlin.codegen.CustomBytecodeTextTest +import org.jetbrains.kotlin.test.ConfigurationKind +import org.jetbrains.kotlin.test.TargetBackend + +open class IrCustomBytecodeTextTest : CustomBytecodeTextTest() { + override val backend: TargetBackend + get() = TargetBackend.JVM_IR + + override fun testEnumMapping() { + createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.ALL) + myFiles = CodegenTestFiles.create( + "whenMappingOrder.kt", + """ + enum class MyEnum { + ENTRY1, ENTRY2, ENTRY3, ENTRY4 + } + + fun f(e: MyEnum) { + when (e) { + MyEnum.ENTRY4 -> {} + MyEnum.ENTRY3 -> {} + MyEnum.ENTRY2 -> {} + MyEnum.ENTRY1 -> {} + } + } + """, + myEnvironment.project + ) + + val text = generateToText() + val getstatics = text.lines().filter { it.contains("GETSTATIC MyEnum.") }.map { it.trim() } + assertOrderedEquals( + "actual bytecode:\n$text", + getstatics, + listOf( + "GETSTATIC MyEnum.${'$'}VALUES : [LMyEnum;", + "GETSTATIC MyEnum.${'$'}ENTRIES : Lkotlin/enums/EnumEntries;", + "GETSTATIC MyEnum.ENTRY1 : LMyEnum;", + "GETSTATIC MyEnum.ENTRY2 : LMyEnum;", + "GETSTATIC MyEnum.ENTRY3 : LMyEnum;", + "GETSTATIC MyEnum.ENTRY4 : LMyEnum;", + "GETSTATIC MyEnum.${'$'}VALUES : [LMyEnum;", + "GETSTATIC MyEnum.ENTRY4 : LMyEnum;", + "GETSTATIC MyEnum.ENTRY3 : LMyEnum;", + "GETSTATIC MyEnum.ENTRY2 : LMyEnum;", + "GETSTATIC MyEnum.ENTRY1 : LMyEnum;" + ) + ) + } +} \ No newline at end of file diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrGenerateNotNullAssertionsTest.java b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrGenerateNotNullAssertionsTest.java index 6476913d41a..a8a0df9bbef 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrGenerateNotNullAssertionsTest.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrGenerateNotNullAssertionsTest.java @@ -6,17 +6,14 @@ package org.jetbrains.kotlin.codegen.ir; import org.jetbrains.annotations.NotNull; -import org.jetbrains.kotlin.codegen.AbstractGenerateNotNullAssertionsTest; +import org.jetbrains.kotlin.codegen.GenerateNotNullAssertionsTest; import org.jetbrains.kotlin.test.TargetBackend; -public class IrGenerateNotNullAssertionsTest extends AbstractGenerateNotNullAssertionsTest { - public void testNoAssertionsForKotlinFromBinary() { - doTestNoAssertionsForKotlinFromBinary("noAssertionsForKotlin.kt", "noAssertionsForKotlinMain.kt"); - } - +@SuppressWarnings("JUnitTestCaseWithNoTests") +public class IrGenerateNotNullAssertionsTest extends GenerateNotNullAssertionsTest { @NotNull @Override - protected TargetBackend getBackend() { + public TargetBackend getBackend() { return TargetBackend.JVM_IR; } } diff --git a/compiler/tests/org/jetbrains/kotlin/jvm/compiler/JvmIrLinkageModeTest.kt b/compiler/tests/org/jetbrains/kotlin/jvm/compiler/JvmIrLinkageModeTest.kt index e25372e36d0..6e5a3a388c0 100644 --- a/compiler/tests/org/jetbrains/kotlin/jvm/compiler/JvmIrLinkageModeTest.kt +++ b/compiler/tests/org/jetbrains/kotlin/jvm/compiler/JvmIrLinkageModeTest.kt @@ -23,7 +23,7 @@ import org.jetbrains.kotlin.test.ConfigurationKind import org.jetbrains.kotlin.test.TargetBackend import org.jetbrains.kotlin.utils.addIfNotNull -class JvmIrLinkageModeTest : CodegenTestCase() { +open class JvmIrLinkageModeTest : CodegenTestCase() { override val backend: TargetBackend get() = TargetBackend.JVM_IR diff --git a/compiler/tests/org/jetbrains/kotlin/jvm/compiler/fir/FirPsiJvmIrLinkageModeTest.kt b/compiler/tests/org/jetbrains/kotlin/jvm/compiler/fir/FirPsiJvmIrLinkageModeTest.kt new file mode 100644 index 00000000000..d4da82b399f --- /dev/null +++ b/compiler/tests/org/jetbrains/kotlin/jvm/compiler/fir/FirPsiJvmIrLinkageModeTest.kt @@ -0,0 +1,18 @@ +/* + * Copyright 2010-2024 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.jvm.compiler.fir + +import org.jetbrains.kotlin.jvm.compiler.ir.IrJvmIrLinkageModeTest +import org.jetbrains.kotlin.test.FirParser + +@Suppress("JUnitTestCaseWithNoTests") +class FirPsiJvmIrLinkageModeTest : IrJvmIrLinkageModeTest() { + override val useFir: Boolean + get() = true + + override val firParser: FirParser + get() = FirParser.Psi +} diff --git a/compiler/tests/org/jetbrains/kotlin/jvm/compiler/ir/IrJvmIrLinkageModeTest.kt b/compiler/tests/org/jetbrains/kotlin/jvm/compiler/ir/IrJvmIrLinkageModeTest.kt new file mode 100644 index 00000000000..695907eadfe --- /dev/null +++ b/compiler/tests/org/jetbrains/kotlin/jvm/compiler/ir/IrJvmIrLinkageModeTest.kt @@ -0,0 +1,15 @@ +/* + * Copyright 2010-2024 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.jvm.compiler.ir + +import org.jetbrains.kotlin.jvm.compiler.JvmIrLinkageModeTest +import org.jetbrains.kotlin.test.TargetBackend + +@Suppress("JUnitTestCaseWithNoTests") +open class IrJvmIrLinkageModeTest : JvmIrLinkageModeTest() { + override val backend: TargetBackend + get() = TargetBackend.JVM_IR +} diff --git a/compiler/tests/org/jetbrains/kotlin/serialization/AbstractJvmVersionRequirementTest.kt b/compiler/tests/org/jetbrains/kotlin/serialization/AbstractJvmVersionRequirementTest.kt new file mode 100644 index 00000000000..829bb089af9 --- /dev/null +++ b/compiler/tests/org/jetbrains/kotlin/serialization/AbstractJvmVersionRequirementTest.kt @@ -0,0 +1,56 @@ +/* + * Copyright 2010-2024 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.serialization + +import org.jetbrains.kotlin.cli.jvm.compiler.EnvironmentConfigFiles +import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment +import org.jetbrains.kotlin.config.* +import org.jetbrains.kotlin.descriptors.ModuleDescriptor +import org.jetbrains.kotlin.jvm.compiler.LoadDescriptorUtil +import org.jetbrains.kotlin.resolve.lazy.JvmResolveUtil +import org.jetbrains.kotlin.test.ConfigurationKind +import org.jetbrains.kotlin.test.KotlinTestUtils +import org.jetbrains.kotlin.test.TestJdkKind +import org.jetbrains.kotlin.test.testFramework.FrontendBackendConfiguration +import java.io.File + +abstract class AbstractJvmVersionRequirementTest : AbstractVersionRequirementTest(), FrontendBackendConfiguration { + override fun compileFiles( + files: List, + outputDirectory: File, + languageVersion: LanguageVersion, + analysisFlags: Map, Any?>, + specificFeatures: Map, + ) { + LoadDescriptorUtil.compileKotlinToDirAndGetModule( + listOf(File("compiler/testData/versionRequirement/${getTestName(true)}.kt")), outputDirectory, + KotlinCoreEnvironment.createForTests( + testRootDisposable, + KotlinTestUtils.newConfiguration(ConfigurationKind.ALL, TestJdkKind.MOCK_JDK, outputDirectory).apply { + languageVersionSettings = LanguageVersionSettingsImpl( + languageVersion, + ApiVersion.createByLanguageVersion(languageVersion), + analysisFlags.toMap() + mapOf(AnalysisFlags.explicitApiVersion to true), + specificFeatures + ) + }.also { + configureIrFir(it) + }, + EnvironmentConfigFiles.JVM_CONFIG_FILES + ) + ) + } + + override fun loadModule(directory: File): ModuleDescriptor = JvmResolveUtil.analyze( + KotlinCoreEnvironment.createForTests( + testRootDisposable, + KotlinTestUtils.newConfiguration(ConfigurationKind.ALL, TestJdkKind.MOCK_JDK, tmpdir).also { + configureIrFir(it) + }, + EnvironmentConfigFiles.JVM_CONFIG_FILES + ) + ).moduleDescriptor +} diff --git a/compiler/tests/org/jetbrains/kotlin/serialization/JvmVersionRequirementTest.kt b/compiler/tests/org/jetbrains/kotlin/serialization/JvmVersionRequirementTest.kt deleted file mode 100644 index f4e26cdb555..00000000000 --- a/compiler/tests/org/jetbrains/kotlin/serialization/JvmVersionRequirementTest.kt +++ /dev/null @@ -1,146 +0,0 @@ -/* - * Copyright 2010-2017 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. - */ - -package org.jetbrains.kotlin.serialization - -import org.jetbrains.kotlin.cli.jvm.compiler.EnvironmentConfigFiles -import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment -import org.jetbrains.kotlin.config.* -import org.jetbrains.kotlin.descriptors.ModuleDescriptor -import org.jetbrains.kotlin.jvm.compiler.LoadDescriptorUtil -import org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.VersionKind.LANGUAGE_VERSION -import org.jetbrains.kotlin.metadata.ProtoBuf.VersionRequirement.VersionKind.COMPILER_VERSION -import org.jetbrains.kotlin.metadata.deserialization.VersionRequirement -import org.jetbrains.kotlin.resolve.lazy.JvmResolveUtil -import org.jetbrains.kotlin.test.ConfigurationKind -import org.jetbrains.kotlin.test.KotlinTestUtils -import org.jetbrains.kotlin.test.TestJdkKind -import java.io.File - -class JvmVersionRequirementTest : AbstractVersionRequirementTest() { - override fun compileFiles( - files: List, - outputDirectory: File, - languageVersion: LanguageVersion, - analysisFlags: Map, Any?>, - specificFeatures: Map - ) { - LoadDescriptorUtil.compileKotlinToDirAndGetModule( - listOf(File("compiler/testData/versionRequirement/${getTestName(true)}.kt")), outputDirectory, - KotlinCoreEnvironment.createForTests( - testRootDisposable, - KotlinTestUtils.newConfiguration(ConfigurationKind.ALL, TestJdkKind.MOCK_JDK, outputDirectory).apply { - languageVersionSettings = LanguageVersionSettingsImpl( - languageVersion, - ApiVersion.createByLanguageVersion(languageVersion), - analysisFlags.toMap() + mapOf(AnalysisFlags.explicitApiVersion to true), - specificFeatures - ) - }, - EnvironmentConfigFiles.JVM_CONFIG_FILES - ) - ) - } - - override fun loadModule(directory: File): ModuleDescriptor = JvmResolveUtil.analyze( - KotlinCoreEnvironment.createForTests( - testRootDisposable, - KotlinTestUtils.newConfiguration(ConfigurationKind.ALL, TestJdkKind.MOCK_JDK, tmpdir), - EnvironmentConfigFiles.JVM_CONFIG_FILES - ) - ).moduleDescriptor - - fun testAllJvmDefault() { - doTest( - VersionRequirement.Version(1, 4, 0), DeprecationLevel.ERROR, null, COMPILER_VERSION, null, - analysisFlags = mapOf(JvmAnalysisFlags.jvmDefaultMode to JvmDefaultMode.ALL), - fqNamesWithRequirements = listOf( - "test.Base", - "test.Derived", - "test.BaseWithProperty", - "test.DerivedWithProperty", - "test.Empty", - "test.EmptyWithNested", - "test.WithAbstractDeclaration", - "test.DerivedFromWithAbstractDeclaration" - ) - ) - } - - fun testAllCompatibilityJvmDefault() { - doTest( - VersionRequirement.Version(1, 4, 0), DeprecationLevel.ERROR, null, COMPILER_VERSION, null, - analysisFlags = mapOf(JvmAnalysisFlags.jvmDefaultMode to JvmDefaultMode.ALL_COMPATIBILITY), - fqNamesWithRequirements = emptyList(), - fqNamesWithoutRequirement = listOf( - "test.Base", - "test.Derived", - "test.BaseWithProperty", - "test.DerivedWithProperty", - "test.Empty", - "test.EmptyWithNested", - "test.WithAbstractDeclaration", - "test.DerivedFromWithAbstractDeclaration" - ) - ) - } - - fun testInlineParameterNullCheck() { - doTest( - VersionRequirement.Version(1, 3, 50), DeprecationLevel.ERROR, null, COMPILER_VERSION, null, - fqNamesWithRequirements = listOf( - "test.doRun", - "test.lambdaVarProperty", - "test.extensionProperty" - ), - customLanguageVersion = LanguageVersion.KOTLIN_1_4 - ) - } - - fun testInlineClassReturnTypeMangled() { - // Class members returning inline class values are mangled, - // and have "language >= 1.4" and "compiler >= 1.4.30" version requirements. - doTest( - VersionRequirement.Version(1, 4, 0), DeprecationLevel.ERROR, null, LANGUAGE_VERSION, null, - fqNamesWithRequirements = listOf( - "test.C.returnsInlineClassType", - "test.C.propertyOfInlineClassType" - ), - customLanguageVersion = LanguageVersion.KOTLIN_1_4, - shouldBeSingleRequirement = false - ) - doTest( - VersionRequirement.Version(1, 4, 30), DeprecationLevel.ERROR, null, COMPILER_VERSION, null, - fqNamesWithRequirements = listOf( - "test.C.returnsInlineClassType", - "test.C.propertyOfInlineClassType", - ), - customLanguageVersion = LanguageVersion.KOTLIN_1_4, - shouldBeSingleRequirement = false, - ) - } - - fun testInlineClassesAndRelevantDeclarations1430() { - doTest( - VersionRequirement.Version(1, 4, 30), DeprecationLevel.ERROR, null, COMPILER_VERSION, null, - fqNamesWithRequirements = listOf( - "test.simpleFun", - "test.aliasedFun", - ), - shouldBeSingleRequirement = false - ) - } -} diff --git a/compiler/tests/org/jetbrains/kotlin/serialization/K1JvmVersionRequirementTest.kt b/compiler/tests/org/jetbrains/kotlin/serialization/K1JvmVersionRequirementTest.kt new file mode 100644 index 00000000000..d83bdd0c0ee --- /dev/null +++ b/compiler/tests/org/jetbrains/kotlin/serialization/K1JvmVersionRequirementTest.kt @@ -0,0 +1,101 @@ +/* + * Copyright 2010-2024 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.serialization + +import org.jetbrains.kotlin.config.JvmAnalysisFlags +import org.jetbrains.kotlin.config.JvmDefaultMode +import org.jetbrains.kotlin.config.LanguageVersion +import org.jetbrains.kotlin.metadata.ProtoBuf +import org.jetbrains.kotlin.metadata.deserialization.VersionRequirement + +class K1JvmVersionRequirementTest : AbstractJvmVersionRequirementTest() { + fun testAllJvmDefault() { + doTest( + VersionRequirement.Version(1, 4, 0), DeprecationLevel.ERROR, null, + ProtoBuf.VersionRequirement.VersionKind.COMPILER_VERSION, null, + analysisFlags = mapOf(JvmAnalysisFlags.jvmDefaultMode to JvmDefaultMode.ALL), + fqNamesWithRequirements = listOf( + "test.Base", + "test.Derived", + "test.BaseWithProperty", + "test.DerivedWithProperty", + "test.Empty", + "test.EmptyWithNested", + "test.WithAbstractDeclaration", + "test.DerivedFromWithAbstractDeclaration" + ) + ) + } + + fun testAllCompatibilityJvmDefault() { + doTest( + VersionRequirement.Version(1, 4, 0), DeprecationLevel.ERROR, null, + ProtoBuf.VersionRequirement.VersionKind.COMPILER_VERSION, null, + analysisFlags = mapOf(JvmAnalysisFlags.jvmDefaultMode to JvmDefaultMode.ALL_COMPATIBILITY), + fqNamesWithRequirements = emptyList(), + fqNamesWithoutRequirement = listOf( + "test.Base", + "test.Derived", + "test.BaseWithProperty", + "test.DerivedWithProperty", + "test.Empty", + "test.EmptyWithNested", + "test.WithAbstractDeclaration", + "test.DerivedFromWithAbstractDeclaration" + ) + ) + } + + fun testInlineParameterNullCheck() { + doTest( + VersionRequirement.Version(1, 3, 50), DeprecationLevel.ERROR, null, + ProtoBuf.VersionRequirement.VersionKind.COMPILER_VERSION, null, + fqNamesWithRequirements = listOf( + "test.doRun", + "test.lambdaVarProperty", + "test.extensionProperty" + ), + customLanguageVersion = LanguageVersion.KOTLIN_1_4 + ) + } + + fun testInlineClassReturnTypeMangled() { + // Class members returning inline class values are mangled, + // and have "language >= 1.4" and "compiler >= 1.4.30" version requirements. + doTest( + VersionRequirement.Version(1, 4, 0), DeprecationLevel.ERROR, null, + ProtoBuf.VersionRequirement.VersionKind.LANGUAGE_VERSION, null, + fqNamesWithRequirements = listOf( + "test.C.returnsInlineClassType", + "test.C.propertyOfInlineClassType" + ), + customLanguageVersion = LanguageVersion.KOTLIN_1_4, + shouldBeSingleRequirement = false + ) + doTest( + VersionRequirement.Version(1, 4, 30), DeprecationLevel.ERROR, null, + ProtoBuf.VersionRequirement.VersionKind.COMPILER_VERSION, null, + fqNamesWithRequirements = listOf( + "test.C.returnsInlineClassType", + "test.C.propertyOfInlineClassType", + ), + customLanguageVersion = LanguageVersion.KOTLIN_1_4, + shouldBeSingleRequirement = false, + ) + } + + fun testInlineClassesAndRelevantDeclarations1430() { + doTest( + VersionRequirement.Version(1, 4, 30), DeprecationLevel.ERROR, null, + ProtoBuf.VersionRequirement.VersionKind.COMPILER_VERSION, null, + fqNamesWithRequirements = listOf( + "test.simpleFun", + "test.aliasedFun", + ), + shouldBeSingleRequirement = false + ) + } +} diff --git a/compiler/tests/org/jetbrains/kotlin/serialization/K2JvmVersionRequirementTest.kt b/compiler/tests/org/jetbrains/kotlin/serialization/K2JvmVersionRequirementTest.kt new file mode 100644 index 00000000000..021bff8919e --- /dev/null +++ b/compiler/tests/org/jetbrains/kotlin/serialization/K2JvmVersionRequirementTest.kt @@ -0,0 +1,17 @@ +/* + * Copyright 2010-2024 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.serialization + +import org.jetbrains.kotlin.test.TargetBackend + +@Suppress("JUnitTestCaseWithNoTests") +class K2JvmVersionRequirementTest : AbstractJvmVersionRequirementTest() { + override val useFir: Boolean + get() = true + + override val backend: TargetBackend + get() = TargetBackend.JVM_IR +}