[Test] Get rid of BackendKindExtractor
This commit is contained in:
committed by
teamcityserver
parent
d43d0071a4
commit
ca40cbede5
@@ -8,7 +8,6 @@ package org.jetbrains.kotlin.test.model
|
||||
import org.jetbrains.kotlin.test.directives.model.DirectivesContainer
|
||||
import org.jetbrains.kotlin.test.services.ServiceRegistrationData
|
||||
import org.jetbrains.kotlin.test.services.TestServices
|
||||
import org.jetbrains.kotlin.test.services.backendKindExtractor
|
||||
|
||||
interface ServicesAndDirectivesContainer {
|
||||
val additionalServices: List<ServiceRegistrationData>
|
||||
@@ -51,7 +50,7 @@ abstract class Frontend2BackendConverter<R : ResultingArtifact.FrontendOutput<R>
|
||||
final override val outputKind: BackendKind<I>
|
||||
) : AbstractTestFacade<R, I>() {
|
||||
override fun shouldRunAnalysis(module: TestModule): Boolean {
|
||||
return testServices.backendKindExtractor.backendKind(module.targetBackend) == outputKind
|
||||
return module.backendKind == outputKind
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,6 +60,6 @@ abstract class BackendFacade<I : ResultingArtifact.BackendInput<I>, A : Resultin
|
||||
final override val outputKind: BinaryKind<A>
|
||||
) : AbstractTestFacade<I, A>() {
|
||||
override fun shouldRunAnalysis(module: TestModule): Boolean {
|
||||
return testServices.backendKindExtractor.backendKind(module.targetBackend) == inputKind && module.binaryKind == outputKind
|
||||
return module.backendKind == inputKind && module.binaryKind == outputKind
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ data class TestModule(
|
||||
val targetPlatform: TargetPlatform,
|
||||
val targetBackend: TargetBackend?,
|
||||
val frontendKind: FrontendKind<*>,
|
||||
val backendKind: BackendKind<*>,
|
||||
val binaryKind: BinaryKind<*>,
|
||||
val files: List<TestFile>,
|
||||
val allDependencies: List<DependencyDescription>,
|
||||
|
||||
-15
@@ -1,15 +0,0 @@
|
||||
/*
|
||||
* 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.services
|
||||
|
||||
import org.jetbrains.kotlin.test.TargetBackend
|
||||
import org.jetbrains.kotlin.test.model.BackendKind
|
||||
|
||||
abstract class BackendKindExtractor(protected val testServices: TestServices) : TestService {
|
||||
abstract fun backendKind(targetBackend: TargetBackend?): BackendKind<*>
|
||||
}
|
||||
|
||||
val TestServices.backendKindExtractor: BackendKindExtractor by TestServices.testServiceAccessor()
|
||||
Reference in New Issue
Block a user