diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/interpreter/IrInterpreterAfterFir2IrTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/interpreter/JvmIrInterpreterAfterFir2IrTestGenerated.java similarity index 99% rename from compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/interpreter/IrInterpreterAfterFir2IrTestGenerated.java rename to compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/interpreter/JvmIrInterpreterAfterFir2IrTestGenerated.java index af9bdac84b0..59fbad4a917 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/interpreter/IrInterpreterAfterFir2IrTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/interpreter/JvmIrInterpreterAfterFir2IrTestGenerated.java @@ -19,7 +19,7 @@ import java.util.regex.Pattern; @SuppressWarnings("all") @TestMetadata("compiler/testData/ir/interpreter") @TestDataPath("$PROJECT_ROOT") -public class IrInterpreterAfterFir2IrTestGenerated extends AbstractIrInterpreterAfterFir2IrTest { +public class JvmIrInterpreterAfterFir2IrTestGenerated extends AbstractJvmIrInterpreterAfterFir2IrTest { @Test @TestMetadata("abstract1.kt") public void testAbstract1() throws Exception { diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/interpreter/IrInterpreterAfterPsi2IrTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/interpreter/JvmIrInterpreterAfterPsi2IrTestGenerated.java similarity index 99% rename from compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/interpreter/IrInterpreterAfterPsi2IrTestGenerated.java rename to compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/interpreter/JvmIrInterpreterAfterPsi2IrTestGenerated.java index 4779882850e..31172307270 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/interpreter/IrInterpreterAfterPsi2IrTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/interpreter/JvmIrInterpreterAfterPsi2IrTestGenerated.java @@ -19,7 +19,7 @@ import java.util.regex.Pattern; @SuppressWarnings("all") @TestMetadata("compiler/testData/ir/interpreter") @TestDataPath("$PROJECT_ROOT") -public class IrInterpreterAfterPsi2IrTestGenerated extends AbstractIrInterpreterAfterPsi2IrTest { +public class JvmIrInterpreterAfterPsi2IrTestGenerated extends AbstractJvmIrInterpreterAfterPsi2IrTest { @Test @TestMetadata("abstract1.kt") public void testAbstract1() throws Exception { diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/runners/ir/interpreter/AbstractIrInterpreterTest.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/runners/ir/interpreter/AbstractIrInterpreterTest.kt index 8b1ee0215f0..aba7d72ab0e 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/runners/ir/interpreter/AbstractIrInterpreterTest.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/runners/ir/interpreter/AbstractIrInterpreterTest.kt @@ -29,41 +29,30 @@ import org.jetbrains.kotlin.test.services.configuration.JvmEnvironmentConfigurat import org.jetbrains.kotlin.test.services.sourceProviders.IrInterpreterHelpersSourceFilesProvider open class AbstractIrInterpreterTest( - private val frontendKind: FrontendKind<*> -) : AbstractKotlinCompilerWithTargetBackendTest(TargetBackend.JVM_IR) { + private val frontendKind: FrontendKind<*>, targetBackend: TargetBackend +) : AbstractKotlinCompilerWithTargetBackendTest(targetBackend) { override fun TestConfigurationBuilder.configuration() { globalDefaults { frontend = frontendKind - targetPlatform = JvmPlatforms.defaultJvmPlatform artifactKind = BinaryKind.NoArtifact - targetBackend = TargetBackend.JVM_IR dependencyKind = DependencyKind.Source } - defaultDirectives { - +JvmEnvironmentConfigurationDirectives.FULL_JDK - +JvmEnvironmentConfigurationDirectives.NO_RUNTIME - +LanguageSettingsDirectives.ALLOW_KOTLIN_PACKAGE - } - useConfigurators( ::CommonEnvironmentConfigurator, ::IrInterpreterEnvironmentConfigurator, - ::JvmEnvironmentConfigurator, ) firFrontendStep() classicFrontendStep() + fir2IrStep() psi2IrStep() - jvmIrBackendStep() - irHandlersStep { useHandlers(::IrInterpreterBackendHandler) } - useAdditionalSourceProviders(::IrInterpreterHelpersSourceFilesProvider) - useSourcePreprocessor(::IrInterpreterImplicitKotlinImports) + jvmIrBackendStep() useAfterAnalysisCheckers(::BlackBoxCodegenSuppressor) @@ -71,8 +60,29 @@ open class AbstractIrInterpreterTest( } } -open class AbstractIrInterpreterAfterFir2IrTest : AbstractIrInterpreterTest(FrontendKinds.FIR) -open class AbstractIrInterpreterAfterPsi2IrTest : AbstractIrInterpreterTest(FrontendKinds.ClassicFrontend) +open class AbstractJvmIrInterpreterTest(frontendKind: FrontendKind<*>) : AbstractIrInterpreterTest(frontendKind, TargetBackend.JVM_IR) { + override fun configure(builder: TestConfigurationBuilder) { + super.configure(builder) + with(builder) { + globalDefaults { + targetPlatform = JvmPlatforms.defaultJvmPlatform + } + + defaultDirectives { + +JvmEnvironmentConfigurationDirectives.FULL_JDK + +JvmEnvironmentConfigurationDirectives.NO_RUNTIME + +LanguageSettingsDirectives.ALLOW_KOTLIN_PACKAGE + } + + useConfigurators(::JvmEnvironmentConfigurator) + useAdditionalSourceProviders(::IrInterpreterHelpersSourceFilesProvider) + useSourcePreprocessor(::IrInterpreterImplicitKotlinImports) + } + } +} + +open class AbstractJvmIrInterpreterAfterFir2IrTest : AbstractJvmIrInterpreterTest(FrontendKinds.FIR) +open class AbstractJvmIrInterpreterAfterPsi2IrTest : AbstractJvmIrInterpreterTest(FrontendKinds.ClassicFrontend) class IrInterpreterEnvironmentConfigurator(testServices: TestServices) : EnvironmentConfigurator(testServices) { override fun provideAdditionalAnalysisFlags( diff --git a/compiler/tests-for-compiler-generator/tests/org/jetbrains/kotlin/test/generators/GenerateJUnit5CompilerTests.kt b/compiler/tests-for-compiler-generator/tests/org/jetbrains/kotlin/test/generators/GenerateJUnit5CompilerTests.kt index 1b9cc8c56d9..7efae361868 100644 --- a/compiler/tests-for-compiler-generator/tests/org/jetbrains/kotlin/test/generators/GenerateJUnit5CompilerTests.kt +++ b/compiler/tests-for-compiler-generator/tests/org/jetbrains/kotlin/test/generators/GenerateJUnit5CompilerTests.kt @@ -14,8 +14,8 @@ import org.jetbrains.kotlin.test.runners.ir.AbstractFir2IrTextTest import org.jetbrains.kotlin.test.runners.ir.AbstractIrTextTest import org.jetbrains.kotlin.test.runners.ir.AbstractLightTreeFir2IrTextTest import org.jetbrains.kotlin.test.runners.ir.AbstractLoweredIrInterpreterTest -import org.jetbrains.kotlin.test.runners.ir.interpreter.AbstractIrInterpreterAfterFir2IrTest -import org.jetbrains.kotlin.test.runners.ir.interpreter.AbstractIrInterpreterAfterPsi2IrTest +import org.jetbrains.kotlin.test.runners.ir.interpreter.AbstractJvmIrInterpreterAfterFir2IrTest +import org.jetbrains.kotlin.test.runners.ir.interpreter.AbstractJvmIrInterpreterAfterPsi2IrTest import org.jetbrains.kotlin.test.utils.CUSTOM_TEST_DATA_EXTENSION_PATTERN import org.jetbrains.kotlin.visualizer.fir.AbstractFirVisualizerTest import org.jetbrains.kotlin.visualizer.psi.AbstractPsiVisualizerTest @@ -180,11 +180,11 @@ fun generateJUnit5CompilerTests(args: Array) { model("codegen/asmLike") } - testClass { + testClass { model("ir/interpreter", excludeDirs = listOf("helpers")) } - testClass { + testClass { model("ir/interpreter", excludeDirs = listOf("helpers")) } }