Add possibility to run callback lambda before dispose test project

This commit is contained in:
Ivan Kylchik
2021-03-17 17:04:08 +03:00
committed by TeamCityServer
parent 0f70ec032d
commit dbf1f54c3f
@@ -14,7 +14,7 @@ import java.io.IOException
class TestRunner(private val testConfiguration: TestConfiguration) {
private val failedAssertions = mutableListOf<Throwable>()
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)
}
}