[test] Introduce DeserializedIrBackend backend kind

We have `BackendKinds.IrBackend` for IR emitted by the frontend.

We need a different backend kind for IR deserialized from klibs.

We cannot use `BackendKinds.IrBackend` for that purpose, because we
cannot have two different `IrBackendInput` subclasses with the same
kind.

We need a different `IrBackendInput` subclass for deserialized IR
because the `IrBackendInput` for frontend-emitted IR contains some
properties like `sourceFiles` which don't make sense for
deserialized IR.

Since we now have two backend kinds for IR artifacts, we need to make
certain functions and classes in the test infrastructure generic
over backend kinds.

Note: the JsIrDeserializedFromKlibBackendInput class is not used
anywhere yet. We will use it in the coming commits.
This commit is contained in:
Sergej Jaskiewicz
2023-07-25 12:45:37 +02:00
committed by Space Team
parent 0521b63cb1
commit 2727163a63
15 changed files with 208 additions and 87 deletions
@@ -14,6 +14,7 @@ import org.jetbrains.kotlin.parsing.parseBoolean
import org.jetbrains.kotlin.test.Constructor
import org.jetbrains.kotlin.test.TargetBackend
import org.jetbrains.kotlin.test.backend.ir.IrBackendInput
import org.jetbrains.kotlin.test.bind
import org.jetbrains.kotlin.test.builders.TestConfigurationBuilder
import org.jetbrains.kotlin.test.builders.configureJsArtifactsHandlersStep
import org.jetbrains.kotlin.test.builders.jsArtifactsHandlersStep
@@ -207,7 +208,9 @@ open class AbstractIrJsSteppingTest : AbstractJsIrTest(
}
useAdditionalSourceProviders(::JsSteppingTestAdditionalSourceProvider)
jsArtifactsHandlersStep {
useHandlers({ JsDebugRunner(it, localVariables = false) })
useHandlers(
::JsDebugRunner.bind(false)
)
}
}
}
@@ -223,7 +226,9 @@ open class AbstractIrJsLocalVariableTest : AbstractJsIrTest(
}
useAdditionalSourceProviders(::JsSteppingTestAdditionalSourceProvider)
jsArtifactsHandlersStep {
useHandlers({ JsDebugRunner(it, localVariables = true) })
useHandlers(
::JsDebugRunner.bind(true)
)
}
}
}