Extract JVM logic of AbstractIrInterpreterTest into separate class
This commit is contained in:
+1
-1
@@ -19,7 +19,7 @@ import java.util.regex.Pattern;
|
|||||||
@SuppressWarnings("all")
|
@SuppressWarnings("all")
|
||||||
@TestMetadata("compiler/testData/ir/interpreter")
|
@TestMetadata("compiler/testData/ir/interpreter")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
public class IrInterpreterAfterFir2IrTestGenerated extends AbstractIrInterpreterAfterFir2IrTest {
|
public class JvmIrInterpreterAfterFir2IrTestGenerated extends AbstractJvmIrInterpreterAfterFir2IrTest {
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("abstract1.kt")
|
@TestMetadata("abstract1.kt")
|
||||||
public void testAbstract1() throws Exception {
|
public void testAbstract1() throws Exception {
|
||||||
+1
-1
@@ -19,7 +19,7 @@ import java.util.regex.Pattern;
|
|||||||
@SuppressWarnings("all")
|
@SuppressWarnings("all")
|
||||||
@TestMetadata("compiler/testData/ir/interpreter")
|
@TestMetadata("compiler/testData/ir/interpreter")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
public class IrInterpreterAfterPsi2IrTestGenerated extends AbstractIrInterpreterAfterPsi2IrTest {
|
public class JvmIrInterpreterAfterPsi2IrTestGenerated extends AbstractJvmIrInterpreterAfterPsi2IrTest {
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("abstract1.kt")
|
@TestMetadata("abstract1.kt")
|
||||||
public void testAbstract1() throws Exception {
|
public void testAbstract1() throws Exception {
|
||||||
+27
-17
@@ -29,41 +29,30 @@ import org.jetbrains.kotlin.test.services.configuration.JvmEnvironmentConfigurat
|
|||||||
import org.jetbrains.kotlin.test.services.sourceProviders.IrInterpreterHelpersSourceFilesProvider
|
import org.jetbrains.kotlin.test.services.sourceProviders.IrInterpreterHelpersSourceFilesProvider
|
||||||
|
|
||||||
open class AbstractIrInterpreterTest(
|
open class AbstractIrInterpreterTest(
|
||||||
private val frontendKind: FrontendKind<*>
|
private val frontendKind: FrontendKind<*>, targetBackend: TargetBackend
|
||||||
) : AbstractKotlinCompilerWithTargetBackendTest(TargetBackend.JVM_IR) {
|
) : AbstractKotlinCompilerWithTargetBackendTest(targetBackend) {
|
||||||
override fun TestConfigurationBuilder.configuration() {
|
override fun TestConfigurationBuilder.configuration() {
|
||||||
globalDefaults {
|
globalDefaults {
|
||||||
frontend = frontendKind
|
frontend = frontendKind
|
||||||
targetPlatform = JvmPlatforms.defaultJvmPlatform
|
|
||||||
artifactKind = BinaryKind.NoArtifact
|
artifactKind = BinaryKind.NoArtifact
|
||||||
targetBackend = TargetBackend.JVM_IR
|
|
||||||
dependencyKind = DependencyKind.Source
|
dependencyKind = DependencyKind.Source
|
||||||
}
|
}
|
||||||
|
|
||||||
defaultDirectives {
|
|
||||||
+JvmEnvironmentConfigurationDirectives.FULL_JDK
|
|
||||||
+JvmEnvironmentConfigurationDirectives.NO_RUNTIME
|
|
||||||
+LanguageSettingsDirectives.ALLOW_KOTLIN_PACKAGE
|
|
||||||
}
|
|
||||||
|
|
||||||
useConfigurators(
|
useConfigurators(
|
||||||
::CommonEnvironmentConfigurator,
|
::CommonEnvironmentConfigurator,
|
||||||
::IrInterpreterEnvironmentConfigurator,
|
::IrInterpreterEnvironmentConfigurator,
|
||||||
::JvmEnvironmentConfigurator,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
firFrontendStep()
|
firFrontendStep()
|
||||||
classicFrontendStep()
|
classicFrontendStep()
|
||||||
|
|
||||||
fir2IrStep()
|
fir2IrStep()
|
||||||
psi2IrStep()
|
psi2IrStep()
|
||||||
jvmIrBackendStep()
|
|
||||||
|
|
||||||
irHandlersStep {
|
irHandlersStep {
|
||||||
useHandlers(::IrInterpreterBackendHandler)
|
useHandlers(::IrInterpreterBackendHandler)
|
||||||
}
|
}
|
||||||
|
|
||||||
useAdditionalSourceProviders(::IrInterpreterHelpersSourceFilesProvider)
|
jvmIrBackendStep()
|
||||||
useSourcePreprocessor(::IrInterpreterImplicitKotlinImports)
|
|
||||||
|
|
||||||
useAfterAnalysisCheckers(::BlackBoxCodegenSuppressor)
|
useAfterAnalysisCheckers(::BlackBoxCodegenSuppressor)
|
||||||
|
|
||||||
@@ -71,8 +60,29 @@ open class AbstractIrInterpreterTest(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
open class AbstractIrInterpreterAfterFir2IrTest : AbstractIrInterpreterTest(FrontendKinds.FIR)
|
open class AbstractJvmIrInterpreterTest(frontendKind: FrontendKind<*>) : AbstractIrInterpreterTest(frontendKind, TargetBackend.JVM_IR) {
|
||||||
open class AbstractIrInterpreterAfterPsi2IrTest : AbstractIrInterpreterTest(FrontendKinds.ClassicFrontend)
|
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) {
|
class IrInterpreterEnvironmentConfigurator(testServices: TestServices) : EnvironmentConfigurator(testServices) {
|
||||||
override fun provideAdditionalAnalysisFlags(
|
override fun provideAdditionalAnalysisFlags(
|
||||||
|
|||||||
+4
-4
@@ -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.AbstractIrTextTest
|
||||||
import org.jetbrains.kotlin.test.runners.ir.AbstractLightTreeFir2IrTextTest
|
import org.jetbrains.kotlin.test.runners.ir.AbstractLightTreeFir2IrTextTest
|
||||||
import org.jetbrains.kotlin.test.runners.ir.AbstractLoweredIrInterpreterTest
|
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.AbstractJvmIrInterpreterAfterFir2IrTest
|
||||||
import org.jetbrains.kotlin.test.runners.ir.interpreter.AbstractIrInterpreterAfterPsi2IrTest
|
import org.jetbrains.kotlin.test.runners.ir.interpreter.AbstractJvmIrInterpreterAfterPsi2IrTest
|
||||||
import org.jetbrains.kotlin.test.utils.CUSTOM_TEST_DATA_EXTENSION_PATTERN
|
import org.jetbrains.kotlin.test.utils.CUSTOM_TEST_DATA_EXTENSION_PATTERN
|
||||||
import org.jetbrains.kotlin.visualizer.fir.AbstractFirVisualizerTest
|
import org.jetbrains.kotlin.visualizer.fir.AbstractFirVisualizerTest
|
||||||
import org.jetbrains.kotlin.visualizer.psi.AbstractPsiVisualizerTest
|
import org.jetbrains.kotlin.visualizer.psi.AbstractPsiVisualizerTest
|
||||||
@@ -180,11 +180,11 @@ fun generateJUnit5CompilerTests(args: Array<String>) {
|
|||||||
model("codegen/asmLike")
|
model("codegen/asmLike")
|
||||||
}
|
}
|
||||||
|
|
||||||
testClass<AbstractIrInterpreterAfterFir2IrTest> {
|
testClass<AbstractJvmIrInterpreterAfterFir2IrTest> {
|
||||||
model("ir/interpreter", excludeDirs = listOf("helpers"))
|
model("ir/interpreter", excludeDirs = listOf("helpers"))
|
||||||
}
|
}
|
||||||
|
|
||||||
testClass<AbstractIrInterpreterAfterPsi2IrTest> {
|
testClass<AbstractJvmIrInterpreterAfterPsi2IrTest> {
|
||||||
model("ir/interpreter", excludeDirs = listOf("helpers"))
|
model("ir/interpreter", excludeDirs = listOf("helpers"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user