[Test] Register DisableLazyResolveChecksAfterAnalysisChecker as first failures suppressor

It's important to filter out failures from lazy resolve before calling other
  suppressors like BlackBoxCodegenSuppressor. Otherwise other suppressors
  can filter out every failure from test and keep it as ignored even if
  the only problem in lazy resolve contracts, which disables with special directive
This commit is contained in:
Dmitriy Novozhilov
2023-07-06 11:04:34 +03:00
committed by Space Team
parent d46f697cf8
commit 32891edc3e
2 changed files with 9 additions and 5 deletions
@@ -196,8 +196,11 @@ class TestConfigurationBuilder {
metaTestConfigurators += configurators
}
fun useAfterAnalysisCheckers(vararg checkers: Constructor<AfterAnalysisChecker>) {
afterAnalysisCheckers += checkers
fun useAfterAnalysisCheckers(vararg checkers: Constructor<AfterAnalysisChecker>, insertAtFirst: Boolean = false) {
when (insertAtFirst) {
false -> afterAnalysisCheckers += checkers
true -> afterAnalysisCheckers.addAll(0, checkers.asList())
}
}
fun defaultDirectives(init: RegisteredDirectivesBuilder.() -> Unit) {
@@ -239,9 +239,10 @@ fun TestConfigurationBuilder.enableLazyResolvePhaseChecking() {
service<FirSessionComponentRegistrar>(::FirLazyDeclarationResolverWithPhaseCheckingSessionComponentRegistrar.coerce())
)
useAfterAnalysisCheckers(
::DisableLazyResolveChecksAfterAnalysisChecker,
)
// It's important to filter out failures from lazy resolve before calling other suppressors like BlackBoxCodegenSuppressor
// Otherwise other suppressors can filter out every failure from test and keep it as ignored even if
// the only problem in lazy resolve contracts, which disables with special directive
useAfterAnalysisCheckers(::DisableLazyResolveChecksAfterAnalysisChecker, insertAtFirst = true)
configureFirHandlersStep {
useHandlers(