Fail on compilation errors in AbstractBytecodeTextTest

This commit is contained in:
Mikhael Bogdanov
2021-02-17 13:41:33 +01:00
parent 61fce74b76
commit 3d8e8dd3ba
11 changed files with 21 additions and 8 deletions
@@ -1,6 +1,7 @@
// !LANGUAGE: +InlineClasses // !LANGUAGE: +InlineClasses
// FILE: Z.kt // FILE: Z.kt
@Suppress("RESERVED_VAR_PROPERTY_OF_VALUE_CLASS")
inline class Z(val x: Int) { inline class Z(val x: Int) {
val aVal: Int val aVal: Int
get() = x get() = x
@@ -1,3 +1,4 @@
// IGNORE_DEXING
class `(X)` { class `(X)` {
fun `(Y)`() {} fun `(Y)`() {}
} }
@@ -1,3 +1,4 @@
// IGNORE_BACKEND: JVM
fun main() { fun main() {
println("FAIL") println("FAIL")
} }
@@ -1,3 +1,5 @@
// IGNORE_BACKEND_FIR: JVM_IR
fun main() fun main()
{ {
l@ if (2 != 1) "fail 3" l@ if (2 != 1) "fail 3"
@@ -1,7 +1,7 @@
// IGNORE_BACKEND: JVM // IGNORE_BACKEND: JVM
fun test(x: Int): String { fun test(x: Int): String {
when { return when {
x == 1 || x == 3 || x == 5 -> "135" x == 1 || x == 3 || x == 5 -> "135"
x == 2 || x == 4 || x == 6 -> "246" x == 2 || x == 4 || x == 6 -> "246"
else -> "other" else -> "other"
@@ -10,6 +10,8 @@ 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.classic.ClassicJvmBackendFacade import org.jetbrains.kotlin.test.backend.classic.ClassicJvmBackendFacade
import org.jetbrains.kotlin.test.backend.handlers.BytecodeTextHandler import org.jetbrains.kotlin.test.backend.handlers.BytecodeTextHandler
import org.jetbrains.kotlin.test.backend.handlers.NoCompilationErrorsHandler
import org.jetbrains.kotlin.test.backend.handlers.NoFirCompilationErrorsHandler
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.directives.JvmEnvironmentConfigurationDirectives import org.jetbrains.kotlin.test.directives.JvmEnvironmentConfigurationDirectives
@@ -42,6 +44,8 @@ abstract class AbstractBytecodeTextTestBase<R : ResultingArtifact.FrontendOutput
+WITH_REFLECT +WITH_REFLECT
} }
commonHandlersForCodegenTest()
useArtifactsHandlers(::BytecodeTextHandler) useArtifactsHandlers(::BytecodeTextHandler)
useAfterAnalysisCheckers(::BlackBoxCodegenSuppressor) useAfterAnalysisCheckers(::BlackBoxCodegenSuppressor)
@@ -40,7 +40,7 @@ abstract class AbstractCompileKotlinAgainstInlineKotlinTestBase<I : ResultingArt
backendFacade backendFacade
) )
useInlineHandlers() useInlineHandlers()
commonHandlersForCodegenTest() commonHandlersForBoxTest()
useModuleStructureTransformers( useModuleStructureTransformers(
ModuleTransformerForTwoFilesBoxTests() ModuleTransformerForTwoFilesBoxTests()
) )
@@ -19,7 +19,6 @@ import org.jetbrains.kotlin.test.frontend.classic.ClassicFrontend2IrConverter
import org.jetbrains.kotlin.test.frontend.classic.ClassicFrontendFacade import org.jetbrains.kotlin.test.frontend.classic.ClassicFrontendFacade
import org.jetbrains.kotlin.test.model.FrontendKinds import org.jetbrains.kotlin.test.model.FrontendKinds
import org.jetbrains.kotlin.test.runners.AbstractKotlinCompilerWithTargetBackendTest import org.jetbrains.kotlin.test.runners.AbstractKotlinCompilerWithTargetBackendTest
import org.jetbrains.kotlin.test.runners.codegen.commonConfigurationForCodegenTest
import org.jetbrains.kotlin.test.services.ModuleTransformerForSwitchingBackend import org.jetbrains.kotlin.test.services.ModuleTransformerForSwitchingBackend
@OptIn(TestInfrastructureInternals::class) @OptIn(TestInfrastructureInternals::class)
@@ -37,7 +36,7 @@ abstract class AbstractJvmIrAgainstOldBoxTestBase(targetBackend: TargetBackend)
::ClassicJvmBackendFacade ::ClassicJvmBackendFacade
) )
commonHandlersForCodegenTest() commonHandlersForBoxTest()
useFrontend2BackendConverters(::ClassicFrontend2IrConverter) useFrontend2BackendConverters(::ClassicFrontend2IrConverter)
useBackendFacades(::JvmIrBackendFacade) useBackendFacades(::JvmIrBackendFacade)
@@ -23,7 +23,7 @@ abstract class AbstractJvmBlackBoxCodegenTestBase<R : ResultingArtifact.Frontend
override fun TestConfigurationBuilder.configuration() { override fun TestConfigurationBuilder.configuration() {
commonConfigurationForCodegenTest(targetFrontend, frontendFacade, frontendToBackendConverter, backendFacade) commonConfigurationForCodegenTest(targetFrontend, frontendFacade, frontendToBackendConverter, backendFacade)
commonHandlersForCodegenTest() commonHandlersForBoxTest()
useArtifactsHandlers(::BytecodeListingHandler) useArtifactsHandlers(::BytecodeListingHandler)
useAfterAnalysisCheckers(::BlackBoxCodegenSuppressor) useAfterAnalysisCheckers(::BlackBoxCodegenSuppressor)
} }
@@ -37,7 +37,7 @@ open class AbstractBackendAgainstBackendBoxTestBase(
useFrontend2BackendConverters(::ClassicFrontend2IrConverter) useFrontend2BackendConverters(::ClassicFrontend2IrConverter)
useBackendFacades(::JvmIrBackendFacade) useBackendFacades(::JvmIrBackendFacade)
commonHandlersForCodegenTest() commonHandlersForBoxTest()
useInlineHandlers() useInlineHandlers()
useAfterAnalysisCheckers(::BlackBoxCodegenSuppressor.bind(CodegenTestDirectives.IGNORE_BACKEND_MULTI_MODULE)) useAfterAnalysisCheckers(::BlackBoxCodegenSuppressor.bind(CodegenTestDirectives.IGNORE_BACKEND_MULTI_MODULE))
@@ -11,7 +11,6 @@ import org.jetbrains.kotlin.test.backend.handlers.*
import org.jetbrains.kotlin.test.builders.TestConfigurationBuilder import org.jetbrains.kotlin.test.builders.TestConfigurationBuilder
import org.jetbrains.kotlin.test.directives.CodegenTestDirectives.DUMP_SMAP import org.jetbrains.kotlin.test.directives.CodegenTestDirectives.DUMP_SMAP
import org.jetbrains.kotlin.test.directives.CodegenTestDirectives.RUN_DEX_CHECKER import org.jetbrains.kotlin.test.directives.CodegenTestDirectives.RUN_DEX_CHECKER
import org.jetbrains.kotlin.test.directives.JvmEnvironmentConfigurationDirectives.USE_PSI_CLASS_FILES_READING
import org.jetbrains.kotlin.test.model.* import org.jetbrains.kotlin.test.model.*
import org.jetbrains.kotlin.test.services.configuration.CommonEnvironmentConfigurator import org.jetbrains.kotlin.test.services.configuration.CommonEnvironmentConfigurator
import org.jetbrains.kotlin.test.services.configuration.JvmEnvironmentConfigurator import org.jetbrains.kotlin.test.services.configuration.JvmEnvironmentConfigurator
@@ -51,6 +50,13 @@ fun <R : ResultingArtifact.FrontendOutput<R>> TestConfigurationBuilder.commonCon
useBackendFacades(backendFacade) useBackendFacades(backendFacade)
} }
fun TestConfigurationBuilder.commonHandlersForBoxTest() {
commonHandlersForCodegenTest()
useArtifactsHandlers(
::JvmBoxRunner
)
}
fun TestConfigurationBuilder.commonHandlersForCodegenTest() { fun TestConfigurationBuilder.commonHandlersForCodegenTest() {
useFrontendHandlers( useFrontendHandlers(
::NoCompilationErrorsHandler, ::NoCompilationErrorsHandler,
@@ -58,7 +64,6 @@ fun TestConfigurationBuilder.commonHandlersForCodegenTest() {
) )
useArtifactsHandlers( useArtifactsHandlers(
::JvmBoxRunner,
::NoJvmSpecificCompilationErrorsHandler, ::NoJvmSpecificCompilationErrorsHandler,
::DxCheckerHandler, ::DxCheckerHandler,
) )