From 9287d2cd24808533cfde241fc8622a2b23c4a4ed Mon Sep 17 00:00:00 2001 From: Simon Ogorodnik Date: Thu, 5 Apr 2018 11:14:55 +0300 Subject: [PATCH] Fix testFailed reporting --- .../idea/perf/AllKotlinInspectionTest.kt | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/idea/performanceTests/org/jetbrains/kotlin/idea/perf/AllKotlinInspectionTest.kt b/idea/performanceTests/org/jetbrains/kotlin/idea/perf/AllKotlinInspectionTest.kt index 26203174058..12f5a312704 100644 --- a/idea/performanceTests/org/jetbrains/kotlin/idea/perf/AllKotlinInspectionTest.kt +++ b/idea/performanceTests/org/jetbrains/kotlin/idea/perf/AllKotlinInspectionTest.kt @@ -129,19 +129,17 @@ class AllKotlinInspectionTest : DaemonAnalyzerTestCase() { println("##teamcity[testStarted name='$name' captureStandardOutput='true']") val (time, errors) = block() if (errors.isNotEmpty()) { -// -// val detailsWriter = StringWriter() -// val errorDetailsPrintWriter = PrintWriter(detailsWriter) -// errors.forEach { -// it.printStackTrace(errorDetailsPrintWriter) -// errorDetailsPrintWriter.println() -// } -// errorDetailsPrintWriter.close() -// val details = detailsWriter.toString() - println("##teamcity[testFailed name='$name' message='Exceptions reported' details='exceptions were thrown while inspecting']") - } else { - println("##teamcity[testFinished name='$name' duration='$time']") + val detailsWriter = StringWriter() + val errorDetailsPrintWriter = PrintWriter(detailsWriter) + errors.forEach { + it.printStackTrace(errorDetailsPrintWriter) + errorDetailsPrintWriter.println() + } + errorDetailsPrintWriter.close() + val details = detailsWriter.toString() + println("##teamcity[testFailed name='$name' message='Exceptions reported' details='${details.tcEscape()}']") } + println("##teamcity[testFinished name='$name' duration='$time']") } fun String.tcEscape(): String {