Tests: fix unmute check for fake override rebuilder tests
Assertion thrown in `check` was wrapped into something and ignored at the call site, for some reason. So the "Looks like this test can be unmuted..." error was never happening for this test.
This commit is contained in:
+6
-11
@@ -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<WrappedException>) {
|
||||
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<WrappedException>): List<WrappedException> {
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user