[Tests] FIR support in JUnit 3 tests, port necessary subclasses
^KT-64404 Fixed ^KT-64438 Fixed ^KT-64407 Fixed
This commit is contained in:
committed by
Space Team
parent
e69d6d2d05
commit
9a2e4c6b41
+3
-2
@@ -26,7 +26,8 @@ abstract class AbstractCompileKotlinAgainstKlibTest : AbstractBlackBoxCodegenTes
|
|||||||
lateinit var outputDir: File
|
lateinit var outputDir: File
|
||||||
lateinit var klibPath: String
|
lateinit var klibPath: String
|
||||||
|
|
||||||
override val backend = TargetBackend.JVM_IR
|
override val backend
|
||||||
|
get() = TargetBackend.JVM_IR
|
||||||
|
|
||||||
override fun doMultiFileTest(wholeFile: File, files: List<TestFile>) {
|
override fun doMultiFileTest(wholeFile: File, files: List<TestFile>) {
|
||||||
outputDir = javaSourcesOutputDirectory
|
outputDir = javaSourcesOutputDirectory
|
||||||
@@ -36,7 +37,7 @@ abstract class AbstractCompileKotlinAgainstKlibTest : AbstractBlackBoxCodegenTes
|
|||||||
val classpath: MutableList<File> = ArrayList()
|
val classpath: MutableList<File> = ArrayList()
|
||||||
classpath.add(KtTestUtil.getAnnotationsJar())
|
classpath.add(KtTestUtil.getAnnotationsJar())
|
||||||
val configuration = createConfiguration(
|
val configuration = createConfiguration(
|
||||||
configurationKind, getTestJdkKind(files), backend, classpath, listOf(outputDir), files
|
configurationKind, getTestJdkKind(files), classpath, listOf(outputDir), files
|
||||||
)
|
)
|
||||||
myEnvironment = createForTests(
|
myEnvironment = createForTests(
|
||||||
testRootDisposable, configuration, EnvironmentConfigFiles.JVM_CONFIG_FILES
|
testRootDisposable, configuration, EnvironmentConfigFiles.JVM_CONFIG_FILES
|
||||||
|
|||||||
-1
@@ -53,7 +53,6 @@ abstract class KotlinMultiFileTestWithJava<M : KotlinBaseTest.TestModule, F : Ko
|
|||||||
val configuration = createConfiguration(
|
val configuration = createConfiguration(
|
||||||
extractConfigurationKind(files),
|
extractConfigurationKind(files),
|
||||||
getTestJdkKind(files),
|
getTestJdkKind(files),
|
||||||
backend,
|
|
||||||
if (additionalClasspath == null) defaultClasspath else defaultClasspath + additionalClasspath,
|
if (additionalClasspath == null) defaultClasspath else defaultClasspath + additionalClasspath,
|
||||||
if (isJavaSourceRootNeeded()) listOf(javaFilesDir) else emptyList(),
|
if (isJavaSourceRootNeeded()) listOf(javaFilesDir) else emptyList(),
|
||||||
files
|
files
|
||||||
|
|||||||
+2
-1
@@ -24,5 +24,6 @@ import org.jetbrains.kotlin.test.TargetBackend
|
|||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
||||||
abstract class AbstractIrKapt3BuilderModeBytecodeShapeTest : AbstractKapt3BuilderModeBytecodeShapeTest() {
|
abstract class AbstractIrKapt3BuilderModeBytecodeShapeTest : AbstractKapt3BuilderModeBytecodeShapeTest() {
|
||||||
override val backend: TargetBackend = TargetBackend.JVM_IR
|
override val backend: TargetBackend
|
||||||
|
get() = TargetBackend.JVM_IR
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -43,7 +43,7 @@ abstract class AbstractLightAnalysisModeTest : CodegenTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
override val backend: TargetBackend
|
final override val backend: TargetBackend
|
||||||
get() = TargetBackend.JVM_IR
|
get() = TargetBackend.JVM_IR
|
||||||
|
|
||||||
override fun doMultiFileTest(wholeFile: File, files: List<TestFile>) {
|
override fun doMultiFileTest(wholeFile: File, files: List<TestFile>) {
|
||||||
@@ -71,7 +71,7 @@ abstract class AbstractLightAnalysisModeTest : CodegenTestCase() {
|
|||||||
|
|
||||||
configurationKind = extractConfigurationKind(files)
|
configurationKind = extractConfigurationKind(files)
|
||||||
val configuration = createConfiguration(
|
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)
|
val environment = KotlinCoreEnvironment.createForTests(testRootDisposable, configuration, EnvironmentConfigFiles.JVM_CONFIG_FILES)
|
||||||
AnalysisHandlerExtension.registerExtension(environment.project, PartialAnalysisHandlerExtension())
|
AnalysisHandlerExtension.registerExtension(environment.project, PartialAnalysisHandlerExtension())
|
||||||
|
|||||||
@@ -89,7 +89,6 @@ public abstract class CodegenTestCase extends KotlinBaseTest<KotlinBaseTest.Test
|
|||||||
CompilerConfiguration configuration = createConfiguration(
|
CompilerConfiguration configuration = createConfiguration(
|
||||||
configurationKind,
|
configurationKind,
|
||||||
testJdkKind,
|
testJdkKind,
|
||||||
getBackend(),
|
|
||||||
Collections.singletonList(getAnnotationsJar()),
|
Collections.singletonList(getAnnotationsJar()),
|
||||||
ArraysKt.filterNotNull(javaSourceRoots),
|
ArraysKt.filterNotNull(javaSourceRoots),
|
||||||
testFilesWithConfigurationDirectives
|
testFilesWithConfigurationDirectives
|
||||||
@@ -379,6 +378,7 @@ public abstract class CodegenTestCase extends KotlinBaseTest<KotlinBaseTest.Test
|
|||||||
@Override
|
@Override
|
||||||
protected void updateConfiguration(@NotNull CompilerConfiguration configuration) {
|
protected void updateConfiguration(@NotNull CompilerConfiguration configuration) {
|
||||||
setCustomDefaultJvmTarget(configuration);
|
setCustomDefaultJvmTarget(configuration);
|
||||||
|
configureIrFir(configuration);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected ClassBuilderFactory getClassBuilderFactory() {
|
protected ClassBuilderFactory getClassBuilderFactory() {
|
||||||
@@ -414,7 +414,7 @@ public abstract class CodegenTestCase extends KotlinBaseTest<KotlinBaseTest.Test
|
|||||||
configurationKind = extractConfigurationKind(files);
|
configurationKind = extractConfigurationKind(files);
|
||||||
|
|
||||||
CompilerConfiguration configuration = createConfiguration(
|
CompilerConfiguration configuration = createConfiguration(
|
||||||
configurationKind, getTestJdkKind(files), getBackend(),
|
configurationKind, getTestJdkKind(files),
|
||||||
Collections.singletonList(getAnnotationsJar()),
|
Collections.singletonList(getAnnotationsJar()),
|
||||||
ArraysKt.filterNotNull(new File[] {javaSourceDir}),
|
ArraysKt.filterNotNull(new File[] {javaSourceDir}),
|
||||||
files
|
files
|
||||||
@@ -508,7 +508,7 @@ public abstract class CodegenTestCase extends KotlinBaseTest<KotlinBaseTest.Test
|
|||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
protected TargetBackend getBackend() {
|
public TargetBackend getBackend() {
|
||||||
return TargetBackend.JVM;
|
return TargetBackend.JVM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+5
-1
@@ -28,7 +28,7 @@ import org.jetbrains.org.objectweb.asm.Opcodes;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
// TODO Remove this class once general multi-module bytecode text tests are implemented.
|
// TODO Remove this class once general multi-module bytecode text tests are implemented.
|
||||||
abstract public class AbstractGenerateNotNullAssertionsTest extends CodegenTestCase {
|
public class GenerateNotNullAssertionsTest extends CodegenTestCase {
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
protected String getPrefix() {
|
protected String getPrefix() {
|
||||||
@@ -101,4 +101,8 @@ abstract public class AbstractGenerateNotNullAssertionsTest extends CodegenTestC
|
|||||||
}
|
}
|
||||||
}, 0);
|
}, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testNoAssertionsForKotlinFromBinary() {
|
||||||
|
doTestNoAssertionsForKotlinFromBinary("noAssertionsForKotlin.kt", "noAssertionsForKotlinMain.kt");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
+16
@@ -0,0 +1,16 @@
|
|||||||
|
/*
|
||||||
|
* 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 org.jetbrains.kotlin.codegen.ir.AbstractIrWriteFlagsTest
|
||||||
|
import org.jetbrains.kotlin.test.FirParser
|
||||||
|
|
||||||
|
abstract class AbstractFirLightTreeWriteFlagsTest : AbstractIrWriteFlagsTest() {
|
||||||
|
override val useFir: Boolean
|
||||||
|
get() = true
|
||||||
|
override val firParser: FirParser
|
||||||
|
get() = FirParser.LightTree
|
||||||
|
}
|
||||||
+17
@@ -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.fir
|
||||||
|
|
||||||
|
import org.jetbrains.kotlin.codegen.ir.AbstractIrWriteSignatureTest
|
||||||
|
import org.jetbrains.kotlin.test.FirParser
|
||||||
|
|
||||||
|
abstract class AbstractFirLightTreeWriteSignatureTest : AbstractIrWriteSignatureTest() {
|
||||||
|
override val useFir: Boolean
|
||||||
|
get() = true
|
||||||
|
|
||||||
|
override val firParser: FirParser
|
||||||
|
get() = FirParser.LightTree
|
||||||
|
}
|
||||||
+16
@@ -0,0 +1,16 @@
|
|||||||
|
/*
|
||||||
|
* 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 org.jetbrains.kotlin.codegen.ir.AbstractIrWriteFlagsTest
|
||||||
|
import org.jetbrains.kotlin.test.FirParser
|
||||||
|
|
||||||
|
abstract class AbstractFirPsiWriteFlagsTest : AbstractIrWriteFlagsTest() {
|
||||||
|
override val useFir: Boolean
|
||||||
|
get() = true
|
||||||
|
override val firParser: FirParser
|
||||||
|
get() = FirParser.Psi
|
||||||
|
}
|
||||||
+17
@@ -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.fir
|
||||||
|
|
||||||
|
import org.jetbrains.kotlin.codegen.ir.AbstractIrWriteSignatureTest
|
||||||
|
import org.jetbrains.kotlin.test.FirParser
|
||||||
|
|
||||||
|
abstract class AbstractFirPsiWriteSignatureTest : AbstractIrWriteSignatureTest() {
|
||||||
|
override val useFir: Boolean
|
||||||
|
get() = true
|
||||||
|
|
||||||
|
override val firParser: FirParser
|
||||||
|
get() = FirParser.Psi
|
||||||
|
}
|
||||||
+2
-1
@@ -12,7 +12,8 @@ import org.jetbrains.kotlin.test.TargetBackend
|
|||||||
|
|
||||||
@OptIn(ObsoleteTestInfrastructure::class)
|
@OptIn(ObsoleteTestInfrastructure::class)
|
||||||
abstract class AbstractComposeLikeIrBlackBoxCodegenTest : AbstractBlackBoxCodegenTest() {
|
abstract class AbstractComposeLikeIrBlackBoxCodegenTest : AbstractBlackBoxCodegenTest() {
|
||||||
override val backend = TargetBackend.JVM_IR
|
override val backend
|
||||||
|
get() = TargetBackend.JVM_IR
|
||||||
|
|
||||||
override fun setupEnvironment(environment: KotlinCoreEnvironment) {
|
override fun setupEnvironment(environment: KotlinCoreEnvironment) {
|
||||||
ComposeLikeExtensionRegistrar.registerComponents(environment.project)
|
ComposeLikeExtensionRegistrar.registerComponents(environment.project)
|
||||||
|
|||||||
+2
-1
@@ -12,7 +12,8 @@ import org.jetbrains.kotlin.test.TargetBackend
|
|||||||
|
|
||||||
@OptIn(ObsoleteTestInfrastructure::class)
|
@OptIn(ObsoleteTestInfrastructure::class)
|
||||||
abstract class AbstractComposeLikeIrBytecodeTextTest : AbstractBytecodeTextTest() {
|
abstract class AbstractComposeLikeIrBytecodeTextTest : AbstractBytecodeTextTest() {
|
||||||
override val backend = TargetBackend.JVM_IR
|
override val backend
|
||||||
|
get() = TargetBackend.JVM_IR
|
||||||
|
|
||||||
override fun setupEnvironment(environment: KotlinCoreEnvironment) {
|
override fun setupEnvironment(environment: KotlinCoreEnvironment) {
|
||||||
ComposeLikeExtensionRegistrar.registerComponents(environment.project)
|
ComposeLikeExtensionRegistrar.registerComponents(environment.project)
|
||||||
|
|||||||
+2
-1
@@ -9,5 +9,6 @@ import org.jetbrains.kotlin.codegen.AbstractCheckLocalVariablesTableTest
|
|||||||
import org.jetbrains.kotlin.test.TargetBackend
|
import org.jetbrains.kotlin.test.TargetBackend
|
||||||
|
|
||||||
abstract class AbstractIrCheckLocalVariablesTableTest : AbstractCheckLocalVariablesTableTest() {
|
abstract class AbstractIrCheckLocalVariablesTableTest : AbstractCheckLocalVariablesTableTest() {
|
||||||
override val backend = TargetBackend.JVM_IR
|
override val backend: TargetBackend
|
||||||
|
get() = TargetBackend.JVM_IR
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-1
@@ -9,5 +9,6 @@ import org.jetbrains.kotlin.codegen.AbstractScriptCodegenTest
|
|||||||
import org.jetbrains.kotlin.test.TargetBackend
|
import org.jetbrains.kotlin.test.TargetBackend
|
||||||
|
|
||||||
abstract class AbstractIrScriptCodegenTest : AbstractScriptCodegenTest() {
|
abstract class AbstractIrScriptCodegenTest : AbstractScriptCodegenTest() {
|
||||||
override val backend = TargetBackend.JVM_IR
|
override val backend
|
||||||
|
get() = TargetBackend.JVM_IR
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-1
@@ -9,5 +9,6 @@ import org.jetbrains.kotlin.codegen.flags.AbstractWriteFlagsTest
|
|||||||
import org.jetbrains.kotlin.test.TargetBackend
|
import org.jetbrains.kotlin.test.TargetBackend
|
||||||
|
|
||||||
abstract class AbstractIrWriteFlagsTest : AbstractWriteFlagsTest() {
|
abstract class AbstractIrWriteFlagsTest : AbstractWriteFlagsTest() {
|
||||||
override val backend = TargetBackend.JVM_IR
|
override val backend
|
||||||
|
get() = TargetBackend.JVM_IR
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-1
@@ -9,5 +9,6 @@ import org.jetbrains.kotlin.jvm.compiler.AbstractWriteSignatureTest
|
|||||||
import org.jetbrains.kotlin.test.TargetBackend
|
import org.jetbrains.kotlin.test.TargetBackend
|
||||||
|
|
||||||
abstract class AbstractIrWriteSignatureTest : AbstractWriteSignatureTest() {
|
abstract class AbstractIrWriteSignatureTest : AbstractWriteSignatureTest() {
|
||||||
override val backend = TargetBackend.JVM_IR
|
override val backend
|
||||||
|
get() = TargetBackend.JVM_IR
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ abstract class AbstractIrGeneratorTestCase : CodegenTestCase() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
val configuration = createConfiguration(
|
val configuration = createConfiguration(
|
||||||
configurationKind, jdkKind, backend,
|
configurationKind, jdkKind,
|
||||||
listOf<File>(getAnnotationsJar()),
|
listOf<File>(getAnnotationsJar()),
|
||||||
listOfNotNull(writeJavaFiles(files)),
|
listOfNotNull(writeJavaFiles(files)),
|
||||||
files
|
files
|
||||||
|
|||||||
+8
-2
@@ -38,6 +38,7 @@ import org.jetbrains.kotlin.test.KotlinTestUtils.createEnvironmentWithMockJdkAnd
|
|||||||
import org.jetbrains.kotlin.test.KotlinTestUtils.newConfiguration
|
import org.jetbrains.kotlin.test.KotlinTestUtils.newConfiguration
|
||||||
import org.jetbrains.kotlin.test.TestCaseWithTmpdir
|
import org.jetbrains.kotlin.test.TestCaseWithTmpdir
|
||||||
import org.jetbrains.kotlin.test.TestJdkKind
|
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.KtTestUtil
|
||||||
import org.jetbrains.kotlin.test.util.RecursiveDescriptorComparatorAdaptor.validateAndCompareDescriptorWithFile
|
import org.jetbrains.kotlin.test.util.RecursiveDescriptorComparatorAdaptor.validateAndCompareDescriptorWithFile
|
||||||
import org.junit.Assert
|
import org.junit.Assert
|
||||||
@@ -45,7 +46,7 @@ import java.io.File
|
|||||||
import java.io.IOException
|
import java.io.IOException
|
||||||
import java.lang.annotation.Retention
|
import java.lang.annotation.Retention
|
||||||
|
|
||||||
abstract class AbstractCompileJavaAgainstKotlinTest : TestCaseWithTmpdir() {
|
abstract class AbstractCompileJavaAgainstKotlinTest : TestCaseWithTmpdir(), FrontendBackendConfiguration {
|
||||||
|
|
||||||
protected fun doTestWithJavac(ktFilePath: String) {
|
protected fun doTestWithJavac(ktFilePath: String) {
|
||||||
doTest(ktFilePath, true)
|
doTest(ktFilePath, true)
|
||||||
@@ -64,6 +65,9 @@ abstract class AbstractCompileJavaAgainstKotlinTest : TestCaseWithTmpdir() {
|
|||||||
|
|
||||||
val out = File(tmpdir, "out")
|
val out = File(tmpdir, "out")
|
||||||
|
|
||||||
|
val directives = KotlinTestUtils.parseDirectives(ktFile.readText())
|
||||||
|
if (useFir && directives.contains("IGNORE_FIR")) return
|
||||||
|
|
||||||
val compiledSuccessfully = if (useJavac) {
|
val compiledSuccessfully = if (useJavac) {
|
||||||
compileKotlinWithJava(
|
compileKotlinWithJava(
|
||||||
listOf(javaFile),
|
listOf(javaFile),
|
||||||
@@ -95,7 +99,9 @@ abstract class AbstractCompileJavaAgainstKotlinTest : TestCaseWithTmpdir() {
|
|||||||
validateAndCompareDescriptorWithFile(packageView, CONFIGURATION, expectedFile)
|
validateAndCompareDescriptorWithFile(packageView, CONFIGURATION, expectedFile)
|
||||||
}
|
}
|
||||||
|
|
||||||
open fun updateConfiguration(configuration: CompilerConfiguration) {}
|
fun updateConfiguration(configuration: CompilerConfiguration) {
|
||||||
|
configureIrFir(configuration)
|
||||||
|
}
|
||||||
|
|
||||||
@Throws(IOException::class)
|
@Throws(IOException::class)
|
||||||
fun compileKotlinWithJava(
|
fun compileKotlinWithJava(
|
||||||
|
|||||||
+5
-2
@@ -37,13 +37,14 @@ import org.jetbrains.kotlin.test.KotlinTestUtils.createEnvironmentWithMockJdkAnd
|
|||||||
import org.jetbrains.kotlin.test.KotlinTestUtils.newConfiguration
|
import org.jetbrains.kotlin.test.KotlinTestUtils.newConfiguration
|
||||||
import org.jetbrains.kotlin.test.TestCaseWithTmpdir
|
import org.jetbrains.kotlin.test.TestCaseWithTmpdir
|
||||||
import org.jetbrains.kotlin.test.TestJdkKind
|
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.KtTestUtil
|
||||||
import org.jetbrains.kotlin.test.util.RecursiveDescriptorComparatorAdaptor.validateAndCompareDescriptorWithFile
|
import org.jetbrains.kotlin.test.util.RecursiveDescriptorComparatorAdaptor.validateAndCompareDescriptorWithFile
|
||||||
import org.junit.Assert
|
import org.junit.Assert
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import java.lang.annotation.Retention
|
import java.lang.annotation.Retention
|
||||||
|
|
||||||
abstract class AbstractCompileKotlinAgainstJavaTest : TestCaseWithTmpdir() {
|
abstract class AbstractCompileKotlinAgainstJavaTest : TestCaseWithTmpdir(), FrontendBackendConfiguration {
|
||||||
|
|
||||||
protected fun doTestWithoutAPT(ktFilePath: String) {
|
protected fun doTestWithoutAPT(ktFilePath: String) {
|
||||||
doTest(ktFilePath, aptMode = false)
|
doTest(ktFilePath, aptMode = false)
|
||||||
@@ -125,7 +126,9 @@ abstract class AbstractCompileKotlinAgainstJavaTest : TestCaseWithTmpdir() {
|
|||||||
return JavacWrapper.getInstance(environment.project).use { it.compile(outDir) }
|
return JavacWrapper.getInstance(environment.project).use { it.compile(outDir) }
|
||||||
}
|
}
|
||||||
|
|
||||||
open fun updateConfiguration(configuration: CompilerConfiguration) {}
|
open fun updateConfiguration(configuration: CompilerConfiguration) {
|
||||||
|
configureIrFir(configuration)
|
||||||
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
// Do not render parameter names because there are test cases where classes inherit from JDK collections,
|
// Do not render parameter names because there are test cases where classes inherit from JDK collections,
|
||||||
|
|||||||
-27
@@ -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)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+1
-1
@@ -217,7 +217,7 @@ public abstract class AbstractLoadJavaTest extends TestCaseWithTmpdir {
|
|||||||
|
|
||||||
protected void configureEnvironment(KotlinCoreEnvironment environment) {}
|
protected void configureEnvironment(KotlinCoreEnvironment environment) {}
|
||||||
|
|
||||||
protected void updateConfiguration(CompilerConfiguration configuration) {}
|
public void updateConfiguration(@NotNull CompilerConfiguration configuration) {}
|
||||||
|
|
||||||
protected void doTestJavaAgainstKotlin(String expectedFileName) {
|
protected void doTestJavaAgainstKotlin(String expectedFileName) {
|
||||||
try {
|
try {
|
||||||
|
|||||||
+8
-1
@@ -16,10 +16,17 @@
|
|||||||
|
|
||||||
package org.jetbrains.kotlin.jvm.compiler
|
package org.jetbrains.kotlin.jvm.compiler
|
||||||
|
|
||||||
|
import org.jetbrains.kotlin.config.CompilerConfiguration
|
||||||
import org.jetbrains.kotlin.test.KotlinTestUtils
|
import org.jetbrains.kotlin.test.KotlinTestUtils
|
||||||
|
import org.jetbrains.kotlin.test.testFramework.FrontendBackendConfiguration
|
||||||
import java.io.File
|
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 usePsiClassFilesReading() = true
|
||||||
|
|
||||||
override fun getExpectedFile(expectedFileName: String): File {
|
override fun getExpectedFile(expectedFileName: String): File {
|
||||||
|
|||||||
+17
@@ -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
|
||||||
|
}
|
||||||
+17
@@ -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
|
||||||
|
}
|
||||||
-10
@@ -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)
|
|
||||||
-10
@@ -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)
|
|
||||||
+3
-3
@@ -5,10 +5,10 @@
|
|||||||
|
|
||||||
package org.jetbrains.kotlin.jvm.compiler.ir
|
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.jvm.compiler.AbstractCompileJavaAgainstKotlinTest
|
||||||
|
import org.jetbrains.kotlin.test.TargetBackend
|
||||||
|
|
||||||
abstract class AbstractIrCompileJavaAgainstKotlinTest : AbstractCompileJavaAgainstKotlinTest() {
|
abstract class AbstractIrCompileJavaAgainstKotlinTest : AbstractCompileJavaAgainstKotlinTest() {
|
||||||
override fun updateConfiguration(configuration: CompilerConfiguration) = configuration.put(JVMConfigurationKeys.IR, true)
|
override val backend: TargetBackend
|
||||||
|
get() = TargetBackend.JVM_IR
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -5,10 +5,10 @@
|
|||||||
|
|
||||||
package org.jetbrains.kotlin.jvm.compiler.ir
|
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.jvm.compiler.AbstractCompileKotlinAgainstJavaTest
|
||||||
|
import org.jetbrains.kotlin.test.TargetBackend
|
||||||
|
|
||||||
abstract class AbstractIrCompileKotlinAgainstJavaTest : AbstractCompileKotlinAgainstJavaTest() {
|
abstract class AbstractIrCompileKotlinAgainstJavaTest : AbstractCompileKotlinAgainstJavaTest() {
|
||||||
override fun updateConfiguration(configuration: CompilerConfiguration) = configuration.put(JVMConfigurationKeys.IR, true)
|
override val backend: TargetBackend
|
||||||
|
get() = TargetBackend.JVM_IR
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -5,10 +5,10 @@
|
|||||||
|
|
||||||
package org.jetbrains.kotlin.jvm.compiler.ir
|
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.jvm.compiler.AbstractLoadJavaWithPsiClassReadingTest
|
||||||
|
import org.jetbrains.kotlin.test.TargetBackend
|
||||||
|
|
||||||
abstract class AbstractIrLoadJavaTest : AbstractLoadJavaWithPsiClassReadingTest() {
|
abstract class AbstractIrLoadJavaTest : AbstractLoadJavaWithPsiClassReadingTest() {
|
||||||
override fun updateConfiguration(configuration: CompilerConfiguration) = configuration.put(JVMConfigurationKeys.IR, true)
|
override val backend: TargetBackend
|
||||||
|
get() = TargetBackend.JVM_IR
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ abstract class AbstractKlibIrTextTestCase : CodegenTestCase() {
|
|||||||
|
|
||||||
private fun setupEnvironment(files: List<TestFile>) {
|
private fun setupEnvironment(files: List<TestFile>) {
|
||||||
val configuration = createConfiguration(
|
val configuration = createConfiguration(
|
||||||
ConfigurationKind.ALL, TestJdkKind.MOCK_JDK, backend,
|
ConfigurationKind.ALL, TestJdkKind.MOCK_JDK,
|
||||||
listOf<File>(KtTestUtil.getAnnotationsJar()),
|
listOf<File>(KtTestUtil.getAnnotationsJar()),
|
||||||
listOfNotNull(writeJavaFiles(files)),
|
listOfNotNull(writeJavaFiles(files)),
|
||||||
files
|
files
|
||||||
|
|||||||
@@ -9,11 +9,12 @@ import org.jetbrains.kotlin.checkers.ENABLE_JVM_PREVIEW
|
|||||||
import org.jetbrains.kotlin.checkers.parseLanguageVersionSettings
|
import org.jetbrains.kotlin.checkers.parseLanguageVersionSettings
|
||||||
import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment
|
import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment
|
||||||
import org.jetbrains.kotlin.config.*
|
import org.jetbrains.kotlin.config.*
|
||||||
|
import org.jetbrains.kotlin.test.testFramework.FrontendBackendConfiguration
|
||||||
import org.jetbrains.kotlin.test.testFramework.KtUsefulTestCase
|
import org.jetbrains.kotlin.test.testFramework.KtUsefulTestCase
|
||||||
import org.jetbrains.kotlin.test.util.KtTestUtil
|
import org.jetbrains.kotlin.test.util.KtTestUtil
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
||||||
abstract class KotlinBaseTest<F : KotlinBaseTest.TestFile> : KtUsefulTestCase() {
|
abstract class KotlinBaseTest<F : KotlinBaseTest.TestFile> : KtUsefulTestCase(), FrontendBackendConfiguration {
|
||||||
@Throws(Exception::class)
|
@Throws(Exception::class)
|
||||||
override fun setUp() {
|
override fun setUp() {
|
||||||
super.setUp()
|
super.setUp()
|
||||||
@@ -51,26 +52,25 @@ abstract class KotlinBaseTest<F : KotlinBaseTest.TestFile> : KtUsefulTestCase()
|
|||||||
return Companion.extractConfigurationKind(files)
|
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 setupEnvironment(environment: KotlinCoreEnvironment) {}
|
||||||
|
|
||||||
protected open fun parseDirectivesPerFiles() = false
|
protected open fun parseDirectivesPerFiles() = false
|
||||||
|
|
||||||
protected open val backend = TargetBackend.ANY
|
|
||||||
|
|
||||||
protected open fun configureTestSpecific(configuration: CompilerConfiguration, testFiles: List<TestFile>) {}
|
protected open fun configureTestSpecific(configuration: CompilerConfiguration, testFiles: List<TestFile>) {}
|
||||||
|
|
||||||
protected fun createConfiguration(
|
protected fun createConfiguration(
|
||||||
kind: ConfigurationKind,
|
kind: ConfigurationKind,
|
||||||
jdkKind: TestJdkKind,
|
jdkKind: TestJdkKind,
|
||||||
backend: TargetBackend,
|
|
||||||
classpath: List<File?>,
|
classpath: List<File?>,
|
||||||
javaSource: List<File?>,
|
javaSource: List<File?>,
|
||||||
testFilesWithConfigurationDirectives: List<TestFile>
|
testFilesWithConfigurationDirectives: List<TestFile>
|
||||||
): CompilerConfiguration {
|
): CompilerConfiguration {
|
||||||
val configuration = KotlinTestUtils.newConfiguration(kind, jdkKind, classpath, javaSource)
|
val configuration = KotlinTestUtils.newConfiguration(kind, jdkKind, classpath, javaSource)
|
||||||
configuration.put(JVMConfigurationKeys.IR, backend.isIR)
|
|
||||||
updateConfigurationByDirectivesInTestFiles(
|
updateConfigurationByDirectivesInTestFiles(
|
||||||
testFilesWithConfigurationDirectives,
|
testFilesWithConfigurationDirectives,
|
||||||
configuration,
|
configuration,
|
||||||
|
|||||||
+30
@@ -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 -> {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+43
@@ -12,8 +12,13 @@ import org.jetbrains.kotlin.cfg.AbstractPseudoValueTest
|
|||||||
import org.jetbrains.kotlin.cli.AbstractCliTest
|
import org.jetbrains.kotlin.cli.AbstractCliTest
|
||||||
import org.jetbrains.kotlin.codegen.*
|
import org.jetbrains.kotlin.codegen.*
|
||||||
import org.jetbrains.kotlin.codegen.defaultConstructor.AbstractDefaultArgumentsReflectionTest
|
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.flags.AbstractWriteFlagsTest
|
||||||
import org.jetbrains.kotlin.codegen.ir.*
|
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.AbstractRawFirBuilderLazyBodiesByAstTest
|
||||||
import org.jetbrains.kotlin.fir.builder.AbstractRawFirBuilderLazyBodiesByStubTest
|
import org.jetbrains.kotlin.fir.builder.AbstractRawFirBuilderLazyBodiesByStubTest
|
||||||
import org.jetbrains.kotlin.fir.builder.AbstractRawFirBuilderSourceElementMappingTestCase
|
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.generators.util.TestGeneratorUtil.KT_OR_KTS_WITHOUT_DOTS_IN_NAME
|
||||||
import org.jetbrains.kotlin.integration.AbstractAntTaskTest
|
import org.jetbrains.kotlin.integration.AbstractAntTaskTest
|
||||||
import org.jetbrains.kotlin.jvm.compiler.*
|
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.ir.*
|
||||||
import org.jetbrains.kotlin.jvm.compiler.javac.AbstractLoadJavaUsingJavacTest
|
import org.jetbrains.kotlin.jvm.compiler.javac.AbstractLoadJavaUsingJavacTest
|
||||||
import org.jetbrains.kotlin.klib.AbstractKlibIrTextTestCase
|
import org.jetbrains.kotlin.klib.AbstractKlibIrTextTestCase
|
||||||
@@ -354,10 +361,46 @@ fun generateJUnit3CompilerTests(args: Array<String>, mainClassName: String?) {
|
|||||||
model("writeFlags", targetBackend = TargetBackend.JVM_IR)
|
model("writeFlags", targetBackend = TargetBackend.JVM_IR)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
testClass<AbstractIrDefaultArgumentsReflectionTest> {
|
||||||
|
model("codegen/defaultArguments/reflection", targetBackend = TargetBackend.JVM_IR)
|
||||||
|
}
|
||||||
|
|
||||||
testClass<AbstractIrWriteSignatureTest> {
|
testClass<AbstractIrWriteSignatureTest> {
|
||||||
model("writeSignature", targetBackend = TargetBackend.JVM_IR)
|
model("writeSignature", targetBackend = TargetBackend.JVM_IR)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
testClass<AbstractFirPsiCheckLocalVariablesTableTest> {
|
||||||
|
model("checkLocalVariablesTable", targetBackend = TargetBackend.JVM_IR)
|
||||||
|
}
|
||||||
|
|
||||||
|
testClass<AbstractFirPsiWriteFlagsTest> {
|
||||||
|
model("writeFlags", targetBackend = TargetBackend.JVM_IR)
|
||||||
|
}
|
||||||
|
|
||||||
|
testClass<AbstractFirPsiDefaultArgumentsReflectionTest> {
|
||||||
|
model("codegen/defaultArguments/reflection", targetBackend = TargetBackend.JVM_IR)
|
||||||
|
}
|
||||||
|
|
||||||
|
testClass<AbstractFirPsiWriteSignatureTest> {
|
||||||
|
model("writeSignature", targetBackend = TargetBackend.JVM_IR)
|
||||||
|
}
|
||||||
|
|
||||||
|
testClass<AbstractFirLightTreeWriteFlagsTest> {
|
||||||
|
model("writeFlags", targetBackend = TargetBackend.JVM_IR)
|
||||||
|
}
|
||||||
|
|
||||||
|
testClass<AbstractFirLightTreeDefaultArgumentsReflectionTest> {
|
||||||
|
model("codegen/defaultArguments/reflection", targetBackend = TargetBackend.JVM_IR)
|
||||||
|
}
|
||||||
|
|
||||||
|
testClass<AbstractFirLightTreeCheckLocalVariablesTableTest> {
|
||||||
|
model("checkLocalVariablesTable", targetBackend = TargetBackend.JVM_IR)
|
||||||
|
}
|
||||||
|
|
||||||
|
testClass<AbstractFirLightTreeWriteSignatureTest> {
|
||||||
|
model("writeSignature", targetBackend = TargetBackend.JVM_IR)
|
||||||
|
}
|
||||||
|
|
||||||
testClass<AbstractIrLoadJavaTest> {
|
testClass<AbstractIrLoadJavaTest> {
|
||||||
model("loadJava/compiledJava", extension = "java", testMethod = "doTestCompiledJava", targetBackend = TargetBackend.JVM_IR)
|
model("loadJava/compiledJava", extension = "java", testMethod = "doTestCompiledJava", targetBackend = TargetBackend.JVM_IR)
|
||||||
model(
|
model(
|
||||||
|
|||||||
+92
@@ -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");
|
||||||
|
}
|
||||||
|
}
|
||||||
+92
@@ -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");
|
||||||
|
}
|
||||||
|
}
|
||||||
+92
@@ -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");
|
||||||
|
}
|
||||||
|
}
|
||||||
+135
@@ -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");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Generated
+1288
File diff suppressed because it is too large
Load Diff
Generated
+683
@@ -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");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
compiler/tests-gen/org/jetbrains/kotlin/codegen/fir/FirPsiCheckLocalVariablesTableTestGenerated.java
Generated
+135
@@ -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");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+1288
File diff suppressed because it is too large
Load Diff
Generated
+683
@@ -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");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+1
-1
@@ -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.
|
* 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 com.intellij.testFramework.TestDataPath;
|
||||||
import org.jetbrains.kotlin.test.JUnit3RunnerWithInners;
|
import org.jetbrains.kotlin.test.JUnit3RunnerWithInners;
|
||||||
+1
-1
@@ -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.
|
* 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 com.intellij.testFramework.TestDataPath;
|
||||||
import org.jetbrains.kotlin.test.JUnit3RunnerWithInners;
|
import org.jetbrains.kotlin.test.JUnit3RunnerWithInners;
|
||||||
@@ -136,7 +136,8 @@ abstract class AbstractCustomScriptCodegenTest : CodegenTestCase() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
abstract class AbstractIrCustomScriptCodegenTest : AbstractCustomScriptCodegenTest() {
|
abstract class AbstractIrCustomScriptCodegenTest : AbstractCustomScriptCodegenTest() {
|
||||||
override val backend: TargetBackend = TargetBackend.JVM_IR
|
override val backend: TargetBackend
|
||||||
|
get() = TargetBackend.JVM_IR
|
||||||
}
|
}
|
||||||
|
|
||||||
object TestScriptWithReceiversConfiguration : ScriptCompilationConfiguration(
|
object TestScriptWithReceiversConfiguration : ScriptCompilationConfiguration(
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ public class ControlStructuresTest extends CodegenTestCase {
|
|||||||
public void testCompareToNonnullableNotEq() throws Exception {
|
public void testCompareToNonnullableNotEq() throws Exception {
|
||||||
loadText("fun foo(a: String?, b: String): Boolean = a != b");
|
loadText("fun foo(a: String?, b: String): Boolean = a != b");
|
||||||
String text = generateToText();
|
String text = generateToText();
|
||||||
assertTrue(text.contains("IXOR"));
|
assertTrue(text, text.contains("IXOR"));
|
||||||
Method main = generateFunction();
|
Method main = generateFunction();
|
||||||
assertEquals(true, main.invoke(null, null, "lala"));
|
assertEquals(true, main.invoke(null, null, "lala"));
|
||||||
assertEquals(false, main.invoke(null, "papa", "papa"));
|
assertEquals(false, main.invoke(null, "papa", "papa"));
|
||||||
|
|||||||
@@ -21,8 +21,8 @@ import org.jetbrains.kotlin.test.ConfigurationKind
|
|||||||
import org.jetbrains.kotlin.test.testFramework.KtUsefulTestCase
|
import org.jetbrains.kotlin.test.testFramework.KtUsefulTestCase
|
||||||
|
|
||||||
@OptIn(ObsoleteTestInfrastructure::class)
|
@OptIn(ObsoleteTestInfrastructure::class)
|
||||||
class CustomBytecodeTextTest : AbstractBytecodeTextTest() {
|
open class CustomBytecodeTextTest : AbstractBytecodeTextTest() {
|
||||||
fun testEnumMapping() {
|
open fun testEnumMapping() {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.ALL)
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.ALL)
|
||||||
myFiles = CodegenTestFiles.create(
|
myFiles = CodegenTestFiles.create(
|
||||||
"whenMappingOrder.kt",
|
"whenMappingOrder.kt",
|
||||||
@@ -46,13 +46,13 @@ class CustomBytecodeTextTest : AbstractBytecodeTextTest() {
|
|||||||
val text = generateToText()
|
val text = generateToText()
|
||||||
val getstatics = text.lines().filter { it.contains("GETSTATIC MyEnum.") }.map { it.trim() }
|
val getstatics = text.lines().filter { it.contains("GETSTATIC MyEnum.") }.map { it.trim() }
|
||||||
KtUsefulTestCase.assertOrderedEquals(
|
KtUsefulTestCase.assertOrderedEquals(
|
||||||
"actual bytecode:\n$text", listOf(
|
"actual bytecode:\n$text", getstatics, listOf(
|
||||||
"GETSTATIC MyEnum.${'$'}VALUES : [LMyEnum;",
|
"GETSTATIC MyEnum.${'$'}VALUES : [LMyEnum;",
|
||||||
"GETSTATIC MyEnum.ENTRY4 : LMyEnum;",
|
"GETSTATIC MyEnum.ENTRY4 : LMyEnum;",
|
||||||
"GETSTATIC MyEnum.ENTRY3 : LMyEnum;",
|
"GETSTATIC MyEnum.ENTRY3 : LMyEnum;",
|
||||||
"GETSTATIC MyEnum.ENTRY2 : LMyEnum;",
|
"GETSTATIC MyEnum.ENTRY2 : LMyEnum;",
|
||||||
"GETSTATIC MyEnum.ENTRY1 : LMyEnum;"
|
"GETSTATIC MyEnum.ENTRY1 : LMyEnum;"
|
||||||
), getstatics
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,9 +25,8 @@ import kotlin.script.experimental.annotations.KotlinScript
|
|||||||
import kotlin.script.experimental.jvm.defaultJvmScriptingHostConfiguration
|
import kotlin.script.experimental.jvm.defaultJvmScriptingHostConfiguration
|
||||||
import kotlin.script.experimental.jvm.util.scriptCompilationClasspathFromContextOrStdlib
|
import kotlin.script.experimental.jvm.util.scriptCompilationClasspathFromContextOrStdlib
|
||||||
|
|
||||||
class CustomScriptCodegenTest : CodegenTestCase() {
|
open class CustomScriptCodegenTest : CodegenTestCase() {
|
||||||
|
open fun testAnnotatedDefinition() {
|
||||||
fun testAnnotatedDefinition() {
|
|
||||||
createScriptTestEnvironment("org.jetbrains.kotlin.codegen.TestScriptWithAnnotatedBaseClass")
|
createScriptTestEnvironment("org.jetbrains.kotlin.codegen.TestScriptWithAnnotatedBaseClass")
|
||||||
loadScript("val x = 1")
|
loadScript("val x = 1")
|
||||||
val res = generateScriptClass()
|
val res = generateScriptClass()
|
||||||
@@ -42,6 +41,9 @@ class CustomScriptCodegenTest : CodegenTestCase() {
|
|||||||
myFiles = CodegenTestFiles.create("scriptTest.kts", text, myEnvironment.project)
|
myFiles = CodegenTestFiles.create("scriptTest.kts", text, myEnvironment.project)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override val backend: TargetBackend
|
||||||
|
get() = TargetBackend.JVM
|
||||||
|
|
||||||
private fun createScriptTestEnvironment(vararg scriptDefinitions: String) {
|
private fun createScriptTestEnvironment(vararg scriptDefinitions: String) {
|
||||||
if (myEnvironment != null) {
|
if (myEnvironment != null) {
|
||||||
throw IllegalStateException("must not set up myEnvironment twice")
|
throw IllegalStateException("must not set up myEnvironment twice")
|
||||||
@@ -60,7 +62,6 @@ class CustomScriptCodegenTest : CodegenTestCase() {
|
|||||||
val configuration = createConfiguration(
|
val configuration = createConfiguration(
|
||||||
ConfigurationKind.ALL,
|
ConfigurationKind.ALL,
|
||||||
TestJdkKind.MOCK_JDK,
|
TestJdkKind.MOCK_JDK,
|
||||||
TargetBackend.JVM,
|
|
||||||
additionalDependencies,
|
additionalDependencies,
|
||||||
emptyList(),
|
emptyList(),
|
||||||
emptyList()
|
emptyList()
|
||||||
|
|||||||
@@ -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");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -24,8 +24,8 @@ import org.jetbrains.org.objectweb.asm.MethodVisitor
|
|||||||
import org.jetbrains.org.objectweb.asm.Opcodes
|
import org.jetbrains.org.objectweb.asm.Opcodes
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
class MethodOrderTest : CodegenTestCase() {
|
open class MethodOrderTest : CodegenTestCase() {
|
||||||
fun testDelegatedMethod() {
|
open fun testDelegatedMethod() {
|
||||||
doTest(
|
doTest(
|
||||||
"""
|
"""
|
||||||
interface Trait {
|
interface Trait {
|
||||||
@@ -48,7 +48,7 @@ class MethodOrderTest : CodegenTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun testLambdaClosureOrdering() {
|
open fun testLambdaClosureOrdering() {
|
||||||
doTest(
|
doTest(
|
||||||
"""
|
"""
|
||||||
class Klass {
|
class Klass {
|
||||||
@@ -66,7 +66,7 @@ class MethodOrderTest : CodegenTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun testAnonymousObjectClosureOrdering() {
|
open fun testAnonymousObjectClosureOrdering() {
|
||||||
doTest(
|
doTest(
|
||||||
"""
|
"""
|
||||||
class Klass {
|
class Klass {
|
||||||
@@ -84,7 +84,7 @@ class MethodOrderTest : CodegenTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun testMemberAccessor() {
|
open fun testMemberAccessor() {
|
||||||
doTest(
|
doTest(
|
||||||
"""
|
"""
|
||||||
class Outer(private val a: Int, private var b: String) {
|
class Outer(private val a: Int, private var b: String) {
|
||||||
@@ -111,7 +111,7 @@ class MethodOrderTest : CodegenTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun testDeterministicDefaultMethodImplOrder() {
|
open fun testDeterministicDefaultMethodImplOrder() {
|
||||||
doTest(
|
doTest(
|
||||||
"""
|
"""
|
||||||
interface Base<K, V> {
|
interface Base<K, V> {
|
||||||
@@ -147,7 +147,7 @@ class MethodOrderTest : CodegenTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun testBridgeOrder() {
|
open fun testBridgeOrder() {
|
||||||
doTest(
|
doTest(
|
||||||
"""
|
"""
|
||||||
interface IrElement
|
interface IrElement
|
||||||
@@ -174,11 +174,12 @@ class MethodOrderTest : CodegenTestCase() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun doTest(sourceText: String, classSuffix: String, expectedOrder: List<String>) {
|
protected fun doTest(sourceText: String, classSuffix: String, expectedOrder: List<String>) {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY)
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY)
|
||||||
myFiles = CodegenTestFiles.create("file.kt", sourceText, myEnvironment!!.project)
|
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 classReader = ClassReader(classFileForObject.asByteArray())
|
||||||
|
|
||||||
val methodNames = ArrayList<String>()
|
val methodNames = ArrayList<String>()
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ package org.jetbrains.kotlin.codegen
|
|||||||
|
|
||||||
import org.jetbrains.kotlin.test.ConfigurationKind
|
import org.jetbrains.kotlin.test.ConfigurationKind
|
||||||
|
|
||||||
class ReflectionClassLoaderTest : CodegenTestCase() {
|
open class ReflectionClassLoaderTest : CodegenTestCase() {
|
||||||
override fun getPrefix() = "reflection/classLoaders"
|
override fun getPrefix() = "reflection/classLoaders"
|
||||||
|
|
||||||
override fun setUp() {
|
override fun setUp() {
|
||||||
|
|||||||
+17
@@ -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
|
||||||
|
}
|
||||||
+17
@@ -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
|
||||||
|
}
|
||||||
+14
@@ -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
|
||||||
|
}
|
||||||
@@ -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("<init>()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
|
||||||
|
}
|
||||||
@@ -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("<init>()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
|
||||||
|
}
|
||||||
@@ -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( "<init>()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("<init>(Ljava/lang/String;IDLjava/lang/Object;JLjava/lang/Object;LKlass;)V", "run()V")
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun testBridgeOrder() {
|
||||||
|
doTest(
|
||||||
|
"""
|
||||||
|
interface IrElement
|
||||||
|
class IrClassContext
|
||||||
|
|
||||||
|
interface IrElementVisitor<out R, in D> {
|
||||||
|
fun visitElement(element: IrElement, data: D): R
|
||||||
|
}
|
||||||
|
|
||||||
|
interface IrElementTransformer<in D> : IrElementVisitor<IrElement, D> {
|
||||||
|
override fun visitElement(element: IrElement, data: D): IrElement =
|
||||||
|
element.also { throw RuntimeException() }
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract class ClassLowerWithContext : IrElementTransformer<IrClassContext?>
|
||||||
|
""",
|
||||||
|
"ClassLowerWithContext",
|
||||||
|
listOf(
|
||||||
|
"<init>()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(
|
||||||
|
"<init>(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<K, V> {
|
||||||
|
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<K, V> : Base<K, V> {
|
||||||
|
override fun removeEldestEntry(eldest: Any?) = true
|
||||||
|
}
|
||||||
|
""",
|
||||||
|
"MinMap",
|
||||||
|
listOf(
|
||||||
|
"<init>()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
|
||||||
|
}
|
||||||
@@ -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;"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -6,17 +6,14 @@
|
|||||||
package org.jetbrains.kotlin.codegen.ir;
|
package org.jetbrains.kotlin.codegen.ir;
|
||||||
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.kotlin.codegen.AbstractGenerateNotNullAssertionsTest;
|
import org.jetbrains.kotlin.codegen.GenerateNotNullAssertionsTest;
|
||||||
import org.jetbrains.kotlin.test.TargetBackend;
|
import org.jetbrains.kotlin.test.TargetBackend;
|
||||||
|
|
||||||
public class IrGenerateNotNullAssertionsTest extends AbstractGenerateNotNullAssertionsTest {
|
@SuppressWarnings("JUnitTestCaseWithNoTests")
|
||||||
public void testNoAssertionsForKotlinFromBinary() {
|
public class IrGenerateNotNullAssertionsTest extends GenerateNotNullAssertionsTest {
|
||||||
doTestNoAssertionsForKotlinFromBinary("noAssertionsForKotlin.kt", "noAssertionsForKotlinMain.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
protected TargetBackend getBackend() {
|
public TargetBackend getBackend() {
|
||||||
return TargetBackend.JVM_IR;
|
return TargetBackend.JVM_IR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import org.jetbrains.kotlin.test.ConfigurationKind
|
|||||||
import org.jetbrains.kotlin.test.TargetBackend
|
import org.jetbrains.kotlin.test.TargetBackend
|
||||||
import org.jetbrains.kotlin.utils.addIfNotNull
|
import org.jetbrains.kotlin.utils.addIfNotNull
|
||||||
|
|
||||||
class JvmIrLinkageModeTest : CodegenTestCase() {
|
open class JvmIrLinkageModeTest : CodegenTestCase() {
|
||||||
override val backend: TargetBackend
|
override val backend: TargetBackend
|
||||||
get() = TargetBackend.JVM_IR
|
get() = TargetBackend.JVM_IR
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
}
|
||||||
@@ -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
|
||||||
|
}
|
||||||
+56
@@ -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<File>,
|
||||||
|
outputDirectory: File,
|
||||||
|
languageVersion: LanguageVersion,
|
||||||
|
analysisFlags: Map<AnalysisFlag<*>, Any?>,
|
||||||
|
specificFeatures: Map<LanguageFeature, LanguageFeature.State>,
|
||||||
|
) {
|
||||||
|
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
|
||||||
|
}
|
||||||
@@ -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<File>,
|
|
||||||
outputDirectory: File,
|
|
||||||
languageVersion: LanguageVersion,
|
|
||||||
analysisFlags: Map<AnalysisFlag<*>, Any?>,
|
|
||||||
specificFeatures: Map<LanguageFeature, LanguageFeature.State>
|
|
||||||
) {
|
|
||||||
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
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -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
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user