[LL FIR] Replace IGNORE_DIAGNOSTIC_API with IGNORE_NON_REVERSED_RESOLVE

This commit is contained in:
Dmitrii Gridin
2024-03-05 16:26:32 +01:00
committed by Space Team
parent 28c80a1581
commit 9ea9950d28
12 changed files with 13 additions and 38 deletions
@@ -5,6 +5,7 @@
package org.jetbrains.kotlin.analysis.low.level.api.fir.diagnostic.compiler.based
import org.jetbrains.kotlin.analysis.low.level.api.fir.LLFirOnlyNonReversedTestSuppressor
import org.jetbrains.kotlin.analysis.low.level.api.fir.compiler.based.AbstractCompilerBasedTestForFir
import org.jetbrains.kotlin.analysis.low.level.api.fir.diagnostic.compiler.based.facades.LLFirAnalyzerFacadeFactoryWithoutPreresolve
import org.jetbrains.kotlin.fir.symbols.FirLazyResolveContractViolationException
@@ -25,7 +26,7 @@ abstract class AbstractDiagnosticCompilerTestDataTest : AbstractCompilerBasedTes
testDataConsistencyHandler = ::ReversedFirIdenticalChecker,
)
useAfterAnalysisCheckers(::ContractViolationSuppressor)
useAfterAnalysisCheckers(::DiagnosticSuppressor)
useAfterAnalysisCheckers(::LLFirOnlyNonReversedTestSuppressor)
}
}
@@ -55,29 +56,3 @@ private class ContractViolationSuppressor(testServices: TestServices) : AfterAna
val IGNORE_CONTRACT_VIOLATIONS by directive("Temporary disables test with contract violation until the issue is fixed")
}
}
private class DiagnosticSuppressor(testServices: TestServices) : AfterAnalysisChecker(testServices) {
override val directiveContainers: List<DirectivesContainer> get() = listOf(Companion)
override fun suppressIfNeeded(failedAssertions: List<WrappedException>): List<WrappedException> {
if (!isDisabled()) {
return failedAssertions
}
return if (failedAssertions.isEmpty()) {
listOf(
AssertionError(
"Test contains $IGNORE_DIAGNOSTIC_API directive but no errors was reported. Please remove directive",
).wrap()
)
} else {
emptyList()
}
}
private fun isDisabled(): Boolean = IGNORE_DIAGNOSTIC_API in testServices.moduleStructure.allDirectives
companion object : SimpleDirectivesContainer() {
val IGNORE_DIAGNOSTIC_API by directive("Temporary disables diagnostic api test until the issue is fixed")
}
}
@@ -2,7 +2,7 @@
// WITH_STDLIB
// SCOPE_DUMP: A:removeAt
// ISSUE: KT-65410
// IGNORE_DIAGNOSTIC_API
// IGNORE_NON_REVERSED_RESOLVE
// IGNORE_REVERSED_RESOLVE
// Reason: SCOPE_DUMP uses different parameter names in AA modes
@@ -1,6 +1,6 @@
// TARGET_BACKEND: JVM
// LANGUAGE: +MultiPlatformProjects
// IGNORE_DIAGNOSTIC_API
// IGNORE_NON_REVERSED_RESOLVE
// IGNORE_REVERSED_RESOLVE
// Reason: MPP diagnostics are reported differentely in the compiler and AA
@@ -1,6 +1,6 @@
// TARGET_BACKEND: JVM
// LANGUAGE: +MultiPlatformProjects
// IGNORE_DIAGNOSTIC_API
// IGNORE_NON_REVERSED_RESOLVE
// IGNORE_REVERSED_RESOLVE
// Reason: MPP diagnostics are reported differentely in the compiler and AA
@@ -1,6 +1,6 @@
// TARGET_BACKEND: JVM
// !LANGUAGE: +MultiPlatformProjects
// IGNORE_DIAGNOSTIC_API
// IGNORE_NON_REVERSED_RESOLVE
// IGNORE_REVERSED_RESOLVE
// Reason: MPP diagnostics are reported differentely in the compiler and AA
@@ -1,6 +1,6 @@
// TARGET_BACKEND: JVM
// !LANGUAGE: +MultiPlatformProjects
// IGNORE_DIAGNOSTIC_API
// IGNORE_NON_REVERSED_RESOLVE
// IGNORE_REVERSED_RESOLVE
// Reason: MPP diagnostics are reported differentely in the compiler and AA
@@ -1,5 +1,5 @@
// LANGUAGE: +MultiPlatformProjects
// IGNORE_DIAGNOSTIC_API
// IGNORE_NON_REVERSED_RESOLVE
// IGNORE_REVERSED_RESOLVE
// Reason: MPP diagnostics are reported differentely in the compiler and AA
@@ -1,5 +1,5 @@
// LANGUAGE: +MultiPlatformProjects
// IGNORE_DIAGNOSTIC_API
// IGNORE_NON_REVERSED_RESOLVE
// IGNORE_REVERSED_RESOLVE
// Reason: MPP diagnostics are reported differentely in the compiler and AA
@@ -1,6 +1,6 @@
// LANGUAGE: +MultiPlatformProjects
// ISSUE: KT-58845
// IGNORE_DIAGNOSTIC_API
// IGNORE_NON_REVERSED_RESOLVE
// IGNORE_REVERSED_RESOLVE
// Reason: MPP diagnostics are reported differentely in the compiler and AA
@@ -1,6 +1,6 @@
// LANGUAGE: +MultiPlatformProjects
// ISSUE: KT-58845
// IGNORE_DIAGNOSTIC_API
// IGNORE_NON_REVERSED_RESOLVE
// IGNORE_REVERSED_RESOLVE
// Reason: MPP diagnostics are reported differentely in the compiler and AA
@@ -1,6 +1,6 @@
// !WITH_NEW_INFERENCE
// IGNORE_REVERSED_RESOLVE
// IGNORE_DIAGNOSTIC_API
// IGNORE_NON_REVERSED_RESOLVE
// DUMP_CFG: LEVELS
// KT-62840
val (a1, a2) = A()
@@ -1,6 +1,6 @@
// !WITH_NEW_INFERENCE
// IGNORE_REVERSED_RESOLVE
// IGNORE_DIAGNOSTIC_API
// IGNORE_NON_REVERSED_RESOLVE
// DUMP_CFG: LEVELS
// KT-62840
val (a1, a2) = A()