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 724111abe66..f7d78f5ef32 100644 --- a/compiler/test-infrastructure/tests/org/jetbrains/kotlin/test/TestRunner.kt +++ b/compiler/test-infrastructure/tests/org/jetbrains/kotlin/test/TestRunner.kt @@ -14,7 +14,7 @@ import java.io.IOException class TestRunner(private val testConfiguration: TestConfiguration) { private val failedAssertions = mutableListOf() - fun runTest(@TestDataFile testDataFileName: String) { + fun runTest(@TestDataFile testDataFileName: String, beforeDispose: (TestConfiguration) -> Unit = {}) { try { runTestImpl(testDataFileName) } finally { @@ -23,6 +23,7 @@ class TestRunner(private val testConfiguration: TestConfiguration) { } catch (_: IOException) { // ignored } + beforeDispose(testConfiguration) Disposer.dispose(testConfiguration.rootDisposable) } }