diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/ir/CodegenWithIrFakeOverrideGeneratorSuppressor.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/ir/CodegenWithIrFakeOverrideGeneratorSuppressor.kt index aea60e89580..0b56ab7ba6f 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/ir/CodegenWithIrFakeOverrideGeneratorSuppressor.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/ir/CodegenWithIrFakeOverrideGeneratorSuppressor.kt @@ -10,23 +10,18 @@ import org.jetbrains.kotlin.test.directives.CodegenTestDirectives.ENABLE_IR_FAKE import org.jetbrains.kotlin.test.directives.CodegenTestDirectives.IGNORE_CODEGEN_WITH_IR_FAKE_OVERRIDE_GENERATION import org.jetbrains.kotlin.test.model.AfterAnalysisChecker import org.jetbrains.kotlin.test.services.TestServices -import org.jetbrains.kotlin.test.services.assertions import org.jetbrains.kotlin.test.services.moduleStructure class CodegenWithIrFakeOverrideGeneratorSuppressor(testServices: TestServices) : AfterAnalysisChecker(testServices) { - override fun check(failedAssertions: List) { - if (!mainDirectiveEnabled) return - if (failedAssertions.isEmpty() && suppressDirectiveEnabled) { - testServices.assertions.fail { - "Looks like this test can be unmuted. Remove $IGNORE_CODEGEN_WITH_IR_FAKE_OVERRIDE_GENERATION directive " - } - } - } - override fun suppressIfNeeded(failedAssertions: List): List { return when { !mainDirectiveEnabled -> failedAssertions - suppressDirectiveEnabled -> emptyList() + suppressDirectiveEnabled -> + if (failedAssertions.isEmpty()) + listOf( + AssertionError("Looks like this test can be unmuted. Remove $IGNORE_CODEGEN_WITH_IR_FAKE_OVERRIDE_GENERATION directive.").wrap() + ) + else emptyList() else -> failedAssertions } }