[Test] Report difference in test data file in a first place

This commit is contained in:
Dmitriy Novozhilov
2020-12-29 12:56:22 +03:00
committed by TeamCityServer
parent 0af1c81d62
commit 009add2b41
@@ -58,7 +58,7 @@ class TestRunner(private val testConfiguration: TestConfiguration) {
withAssertionCatching { handler.processAfterAllModules(failedAssertions.isNotEmpty()) } withAssertionCatching { handler.processAfterAllModules(failedAssertions.isNotEmpty()) }
} }
if (testConfiguration.metaInfoHandlerEnabled) { if (testConfiguration.metaInfoHandlerEnabled) {
withAssertionCatching { withAssertionCatching(insertExceptionInStart = true) {
globalMetadataInfoHandler.compareAllMetaDataInfos() globalMetadataInfoHandler.compareAllMetaDataInfos()
} }
} }
@@ -124,11 +124,15 @@ class TestRunner(private val testConfiguration: TestConfiguration) {
} }
} }
private inline fun withAssertionCatching(block: () -> Unit) { private inline fun withAssertionCatching(insertExceptionInStart: Boolean = false, block: () -> Unit) {
try { try {
block() block()
} catch (e: AssertionError) { } catch (e: AssertionError) {
failedAssertions += e if (insertExceptionInStart) {
failedAssertions.add(0, e)
} else {
failedAssertions += e
}
} }
} }
} }