[Test] Simplify DiagnosticsService
This commit is contained in:
committed by
TeamCityServer
parent
cd890d5833
commit
c73c73e85e
+1
-4
@@ -11,9 +11,6 @@ import org.jetbrains.kotlin.test.util.*
|
|||||||
|
|
||||||
class DiagnosticsService(val testServices: TestServices) : TestService {
|
class DiagnosticsService(val testServices: TestServices) : TestService {
|
||||||
private val conditionsPerModule: MutableMap<TestModule, Condition<String>> = mutableMapOf()
|
private val conditionsPerModule: MutableMap<TestModule, Condition<String>> = mutableMapOf()
|
||||||
private val globalDefinedDiagnostics by lazy {
|
|
||||||
testServices.moduleStructure.allDirectives[DiagnosticsDirectives.DIAGNOSTICS]
|
|
||||||
}
|
|
||||||
|
|
||||||
fun shouldRenderDiagnostic(module: TestModule, name: String): Boolean {
|
fun shouldRenderDiagnostic(module: TestModule, name: String): Boolean {
|
||||||
val condition = conditionsPerModule.getOrPut(module) {
|
val condition = conditionsPerModule.getOrPut(module) {
|
||||||
@@ -23,7 +20,7 @@ class DiagnosticsService(val testServices: TestServices) : TestService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun computeDiagnosticConditionForModule(module: TestModule): Condition<String> {
|
private fun computeDiagnosticConditionForModule(module: TestModule): Condition<String> {
|
||||||
val diagnosticsInDirective = module.directives[DiagnosticsDirectives.DIAGNOSTICS] + globalDefinedDiagnostics
|
val diagnosticsInDirective = module.directives[DiagnosticsDirectives.DIAGNOSTICS]
|
||||||
val enabledNames = mutableSetOf<String>()
|
val enabledNames = mutableSetOf<String>()
|
||||||
val disabledNames = mutableSetOf<String>()
|
val disabledNames = mutableSetOf<String>()
|
||||||
for (diagnosticInDirective in diagnosticsInDirective) {
|
for (diagnosticInDirective in diagnosticsInDirective) {
|
||||||
|
|||||||
Reference in New Issue
Block a user