[Test] Migrate AbstractIrBlackBoxCodegenTest to new infrastructure
This commit is contained in:
committed by
TeamCityServer
parent
f1a2e66ba4
commit
e3c7bd5f85
+37595
File diff suppressed because it is too large
Load Diff
+6
@@ -6,12 +6,16 @@
|
||||
package org.jetbrains.kotlin.test.backend.ir
|
||||
|
||||
import org.jetbrains.kotlin.backend.jvm.JvmIrCodegenFactory
|
||||
import org.jetbrains.kotlin.test.backend.classic.JavaCompilerFacade
|
||||
import org.jetbrains.kotlin.test.model.*
|
||||
import org.jetbrains.kotlin.test.services.TestServices
|
||||
import org.jetbrains.kotlin.test.services.compilerConfigurationProvider
|
||||
|
||||
class JvmIrBackendFacade(
|
||||
testServices: TestServices
|
||||
) : IrBackendFacade<BinaryArtifacts.Jvm>(testServices, ArtifactKinds.Jvm) {
|
||||
private val javaCompilerFacade = JavaCompilerFacade(testServices)
|
||||
|
||||
override fun transform(
|
||||
module: TestModule,
|
||||
inputArtifact: IrBackendInput
|
||||
@@ -20,6 +24,8 @@ class JvmIrBackendFacade(
|
||||
val codegenFactory = state.codegenFactory as JvmIrCodegenFactory
|
||||
codegenFactory.doGenerateFilesInternal(inputArtifact.backendInput)
|
||||
state.factory.done()
|
||||
val configuration = testServices.compilerConfigurationProvider.getCompilerConfiguration(module)
|
||||
javaCompilerFacade.compileJavaFiles(module, configuration, state.factory)
|
||||
|
||||
return BinaryArtifacts.Jvm(state.factory)
|
||||
}
|
||||
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.test.runners.codegen
|
||||
|
||||
import org.jetbrains.kotlin.test.Constructor
|
||||
import org.jetbrains.kotlin.test.TargetBackend
|
||||
import org.jetbrains.kotlin.test.backend.ir.JvmIrBackendFacade
|
||||
import org.jetbrains.kotlin.test.frontend.classic.ClassicFrontend2IrConverter
|
||||
import org.jetbrains.kotlin.test.model.BackendFacade
|
||||
import org.jetbrains.kotlin.test.model.BinaryArtifacts
|
||||
import org.jetbrains.kotlin.test.model.Frontend2BackendConverter
|
||||
|
||||
open class AbstractIrBlackBoxCodegenTest : AbstractJvmBlackBoxCodegenTestBase(TargetBackend.JVM_IR) {
|
||||
override val frontendToBackendConverter: Constructor<Frontend2BackendConverter<*, *>>
|
||||
get() = ::ClassicFrontend2IrConverter
|
||||
|
||||
override val backendFacade: Constructor<BackendFacade<*, BinaryArtifacts.Jvm>>
|
||||
get() = ::JvmIrBackendFacade
|
||||
}
|
||||
Reference in New Issue
Block a user