From 009add2b41ea76d4ce538b868a2fa2a484dc69e7 Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Tue, 29 Dec 2020 12:56:22 +0300 Subject: [PATCH] [Test] Report difference in test data file in a first place --- .../tests/org/jetbrains/kotlin/test/TestRunner.kt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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 fe9b7ccb97f..b4c2ea323b7 100644 --- a/compiler/test-infrastructure/tests/org/jetbrains/kotlin/test/TestRunner.kt +++ b/compiler/test-infrastructure/tests/org/jetbrains/kotlin/test/TestRunner.kt @@ -58,7 +58,7 @@ class TestRunner(private val testConfiguration: TestConfiguration) { withAssertionCatching { handler.processAfterAllModules(failedAssertions.isNotEmpty()) } } if (testConfiguration.metaInfoHandlerEnabled) { - withAssertionCatching { + withAssertionCatching(insertExceptionInStart = true) { 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 { block() } catch (e: AssertionError) { - failedAssertions += e + if (insertExceptionInStart) { + failedAssertions.add(0, e) + } else { + failedAssertions += e + } } } }