diff --git a/compiler/test-infrastructure/tests/org/jetbrains/kotlin/test/TestRunner.kt b/compiler/test-infrastructure/tests/org/jetbrains/kotlin/test/TestRunner.kt index c54cd6207df..77116c83e76 100644 --- a/compiler/test-infrastructure/tests/org/jetbrains/kotlin/test/TestRunner.kt +++ b/compiler/test-infrastructure/tests/org/jetbrains/kotlin/test/TestRunner.kt @@ -134,7 +134,8 @@ class TestRunner(private val testConfiguration: TestConfiguration) { for (step in testConfiguration.steps) { if (!step.shouldProcessModule(module, inputArtifact)) continue - when (val result = step.hackyProcessModule(module, inputArtifact, allFailedExceptions.isNotEmpty())) { + val thereWereCriticalExceptionsOnPreviousSteps = allFailedExceptions.any { it.failureDisablesNextSteps } + when (val result = step.hackyProcessModule(module, inputArtifact, thereWereCriticalExceptionsOnPreviousSteps)) { is TestStep.StepResult.Artifact<*> -> { require(step is TestStep.FacadeStep<*, *>) if (step.inputArtifactKind != step.outputArtifactKind) { diff --git a/compiler/test-infrastructure/tests/org/jetbrains/kotlin/test/WrappedException.kt b/compiler/test-infrastructure/tests/org/jetbrains/kotlin/test/WrappedException.kt index 022a08622eb..495105d626b 100644 --- a/compiler/test-infrastructure/tests/org/jetbrains/kotlin/test/WrappedException.kt +++ b/compiler/test-infrastructure/tests/org/jetbrains/kotlin/test/WrappedException.kt @@ -13,6 +13,13 @@ sealed class WrappedException( val priority: Int, val additionalPriority: Int ) : Exception(cause), Comparable { + /** + * If [failureDisablesNextSteps] is `true`, + * then the following test steps might not be run considering this exception as critical. + * If false, the next steps will ignore this exception and continue running. + */ + open val failureDisablesNextSteps: Boolean get() = true + class FromFacade(cause: Throwable, val facade: AbstractTestFacade<*, *>) : WrappedException(cause, 0, 1) { override val message: String get() = "Exception was thrown" @@ -20,7 +27,10 @@ sealed class WrappedException( class FromMetaInfoHandler(cause: Throwable) : WrappedException(cause, 1, 1) - class FromHandler(cause: Throwable, val handler: AnalysisHandler<*>) : WrappedException(cause, 1, 2) + class FromHandler(cause: Throwable, val handler: AnalysisHandler<*>) : WrappedException(cause, 1, 2) { + override val failureDisablesNextSteps: Boolean + get() = handler.failureDisablesNextSteps + } class FromAfterAnalysisChecker(cause: Throwable) : WrappedException(cause, 2, 1)