From dbf1f54c3f18d6851341c2c9e3814c22737e8434 Mon Sep 17 00:00:00 2001 From: Ivan Kylchik Date: Wed, 17 Mar 2021 17:04:08 +0300 Subject: [PATCH] Add possibility to run callback lambda before dispose test project --- .../tests/org/jetbrains/kotlin/test/TestRunner.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) } }