Tests: minor, inline helper functions used only once

This commit is contained in:
Alexander Udalov
2023-12-07 19:26:42 +01:00
committed by Space Team
parent 0c77fa1fa4
commit c62f8c886b
3 changed files with 12 additions and 24 deletions
@@ -9,9 +9,11 @@ import org.jetbrains.kotlin.test.Constructor
import org.jetbrains.kotlin.test.TargetBackend import org.jetbrains.kotlin.test.TargetBackend
import org.jetbrains.kotlin.test.backend.BlackBoxCodegenSuppressor import org.jetbrains.kotlin.test.backend.BlackBoxCodegenSuppressor
import org.jetbrains.kotlin.test.backend.BlackBoxInlinerCodegenSuppressor import org.jetbrains.kotlin.test.backend.BlackBoxInlinerCodegenSuppressor
import org.jetbrains.kotlin.test.backend.handlers.LocalVariableDebugRunner
import org.jetbrains.kotlin.test.backend.ir.IrBackendInput import org.jetbrains.kotlin.test.backend.ir.IrBackendInput
import org.jetbrains.kotlin.test.backend.ir.JvmIrBackendFacade import org.jetbrains.kotlin.test.backend.ir.JvmIrBackendFacade
import org.jetbrains.kotlin.test.builders.TestConfigurationBuilder import org.jetbrains.kotlin.test.builders.TestConfigurationBuilder
import org.jetbrains.kotlin.test.builders.configureJvmArtifactsHandlersStep
import org.jetbrains.kotlin.test.directives.CodegenTestDirectives.REQUIRES_SEPARATE_PROCESS import org.jetbrains.kotlin.test.directives.CodegenTestDirectives.REQUIRES_SEPARATE_PROCESS
import org.jetbrains.kotlin.test.directives.DiagnosticsDirectives.REPORT_ONLY_EXPLICITLY_DEFINED_DEBUG_INFO import org.jetbrains.kotlin.test.directives.DiagnosticsDirectives.REPORT_ONLY_EXPLICITLY_DEFINED_DEBUG_INFO
import org.jetbrains.kotlin.test.model.Frontend2BackendConverter import org.jetbrains.kotlin.test.model.Frontend2BackendConverter
@@ -31,7 +33,10 @@ abstract class AbstractLocalVariableTestBase<R : ResultingArtifact.FrontendOutpu
commonServicesConfigurationForDebugTest(it) commonServicesConfigurationForDebugTest(it)
} }
configureCommonHandlersForLocalVariableTest() commonHandlersForCodegenTest()
configureJvmArtifactsHandlersStep {
useHandlers(::LocalVariableDebugRunner)
}
useAfterAnalysisCheckers(::BlackBoxCodegenSuppressor, ::BlackBoxInlinerCodegenSuppressor) useAfterAnalysisCheckers(::BlackBoxCodegenSuppressor, ::BlackBoxInlinerCodegenSuppressor)
@@ -9,9 +9,11 @@ import org.jetbrains.kotlin.test.Constructor
import org.jetbrains.kotlin.test.TargetBackend import org.jetbrains.kotlin.test.TargetBackend
import org.jetbrains.kotlin.test.backend.BlackBoxCodegenSuppressor import org.jetbrains.kotlin.test.backend.BlackBoxCodegenSuppressor
import org.jetbrains.kotlin.test.backend.BlackBoxInlinerCodegenSuppressor import org.jetbrains.kotlin.test.backend.BlackBoxInlinerCodegenSuppressor
import org.jetbrains.kotlin.test.backend.handlers.SteppingDebugRunner
import org.jetbrains.kotlin.test.backend.ir.IrBackendInput import org.jetbrains.kotlin.test.backend.ir.IrBackendInput
import org.jetbrains.kotlin.test.backend.ir.JvmIrBackendFacade import org.jetbrains.kotlin.test.backend.ir.JvmIrBackendFacade
import org.jetbrains.kotlin.test.builders.TestConfigurationBuilder import org.jetbrains.kotlin.test.builders.TestConfigurationBuilder
import org.jetbrains.kotlin.test.builders.configureJvmArtifactsHandlersStep
import org.jetbrains.kotlin.test.directives.CodegenTestDirectives.REQUIRES_SEPARATE_PROCESS import org.jetbrains.kotlin.test.directives.CodegenTestDirectives.REQUIRES_SEPARATE_PROCESS
import org.jetbrains.kotlin.test.directives.DiagnosticsDirectives.REPORT_ONLY_EXPLICITLY_DEFINED_DEBUG_INFO import org.jetbrains.kotlin.test.directives.DiagnosticsDirectives.REPORT_ONLY_EXPLICITLY_DEFINED_DEBUG_INFO
import org.jetbrains.kotlin.test.model.Frontend2BackendConverter import org.jetbrains.kotlin.test.model.Frontend2BackendConverter
@@ -31,7 +33,10 @@ abstract class AbstractSteppingTestBase<R : ResultingArtifact.FrontendOutput<R>>
commonServicesConfigurationForDebugTest(it) commonServicesConfigurationForDebugTest(it)
} }
configureCommonHandlersForSteppingTest() commonHandlersForCodegenTest()
configureJvmArtifactsHandlersStep {
useHandlers(::SteppingDebugRunner)
}
useAfterAnalysisCheckers(::BlackBoxCodegenSuppressor, ::BlackBoxInlinerCodegenSuppressor) useAfterAnalysisCheckers(::BlackBoxCodegenSuppressor, ::BlackBoxInlinerCodegenSuppressor)
@@ -122,20 +122,6 @@ fun TestConfigurationBuilder.configureCommonHandlersForBoxTest() {
} }
} }
fun TestConfigurationBuilder.configureCommonHandlersForSteppingTest() {
commonHandlersForCodegenTest()
configureJvmArtifactsHandlersStep {
steppingHandlersForBackendStep()
}
}
fun TestConfigurationBuilder.configureCommonHandlersForLocalVariableTest() {
commonHandlersForCodegenTest()
configureJvmArtifactsHandlersStep {
localVariableHandlersForBackendStep()
}
}
fun TestConfigurationBuilder.commonHandlersForCodegenTest() { fun TestConfigurationBuilder.commonHandlersForCodegenTest() {
configureClassicFrontendHandlersStep { configureClassicFrontendHandlersStep {
commonClassicFrontendHandlersForCodegenTest() commonClassicFrontendHandlersForCodegenTest()
@@ -168,14 +154,6 @@ fun HandlersStepBuilder<BinaryArtifacts.Jvm, ArtifactKinds.Jvm>.boxHandlersForBa
) )
} }
fun HandlersStepBuilder<BinaryArtifacts.Jvm, ArtifactKinds.Jvm>.steppingHandlersForBackendStep() {
useHandlers(::SteppingDebugRunner)
}
fun HandlersStepBuilder<BinaryArtifacts.Jvm, ArtifactKinds.Jvm>.localVariableHandlersForBackendStep() {
useHandlers(::LocalVariableDebugRunner)
}
fun HandlersStepBuilder<ClassicFrontendOutputArtifact, FrontendKinds.ClassicFrontend>.commonClassicFrontendHandlersForCodegenTest() { fun HandlersStepBuilder<ClassicFrontendOutputArtifact, FrontendKinds.ClassicFrontend>.commonClassicFrontendHandlersForCodegenTest() {
useHandlers( useHandlers(
::NoCompilationErrorsHandler, ::NoCompilationErrorsHandler,