From 32891edc3e2bf79c5e6e51dfb0309a2008faf484 Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Thu, 6 Jul 2023 11:04:34 +0300 Subject: [PATCH] [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 --- .../kotlin/test/builders/TestConfigurationBuilder.kt | 7 +++++-- .../kotlin/test/runners/AbstractFirDiagnosticTest.kt | 7 ++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/builders/TestConfigurationBuilder.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/builders/TestConfigurationBuilder.kt index 23caf3ff98a..935e96c1dd0 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/builders/TestConfigurationBuilder.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/builders/TestConfigurationBuilder.kt @@ -196,8 +196,11 @@ class TestConfigurationBuilder { metaTestConfigurators += configurators } - fun useAfterAnalysisCheckers(vararg checkers: Constructor) { - afterAnalysisCheckers += checkers + fun useAfterAnalysisCheckers(vararg checkers: Constructor, insertAtFirst: Boolean = false) { + when (insertAtFirst) { + false -> afterAnalysisCheckers += checkers + true -> afterAnalysisCheckers.addAll(0, checkers.asList()) + } } fun defaultDirectives(init: RegisteredDirectivesBuilder.() -> Unit) { diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/runners/AbstractFirDiagnosticTest.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/runners/AbstractFirDiagnosticTest.kt index 2908372e35c..08d2b238beb 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/runners/AbstractFirDiagnosticTest.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/runners/AbstractFirDiagnosticTest.kt @@ -239,9 +239,10 @@ fun TestConfigurationBuilder.enableLazyResolvePhaseChecking() { service(::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(