From e6a391f024f57cb24fa8cd75098398b8be703ecd Mon Sep 17 00:00:00 2001 From: Pavel Punegov <32519625+PavelPunegov@users.noreply.github.com> Date: Wed, 27 Mar 2019 13:49:52 +0300 Subject: [PATCH] Fix output parse --- backend.native/tests/build.gradle | 4 ++-- .../main/groovy/org/jetbrains/kotlin/KonanTest.groovy | 9 +++------ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/backend.native/tests/build.gradle b/backend.native/tests/build.gradle index e5c8c6f8a7e..03cf2b5c345 100644 --- a/backend.native/tests/build.gradle +++ b/backend.native/tests/build.gradle @@ -2237,8 +2237,8 @@ task multiargs(type: RunStandaloneKonanTest) { arguments = ["AAA", "BB", "C"] multiRuns = true multiArguments = [["1", "2", "3"], ["---"], ["Hello", "world"]] - goldValue = "AAA\nBB\nC\n1\n2\n3" + - "AAA\nBB\nC\n---" + + goldValue = "AAA\nBB\nC\n1\n2\n3\n" + + "AAA\nBB\nC\n---\n" + "AAA\nBB\nC\nHello\nworld\n" source = "runtime/basic/args0.kt" } diff --git a/buildSrc/plugins/src/main/groovy/org/jetbrains/kotlin/KonanTest.groovy b/buildSrc/plugins/src/main/groovy/org/jetbrains/kotlin/KonanTest.groovy index 9e4e8419732..a1956d736f9 100644 --- a/buildSrc/plugins/src/main/groovy/org/jetbrains/kotlin/KonanTest.groovy +++ b/buildSrc/plugins/src/main/groovy/org/jetbrains/kotlin/KonanTest.groovy @@ -287,7 +287,6 @@ abstract class KonanTest extends JavaExec { def times = multiRuns ? multiArguments.size() : 1 - def result = compilerMessagesText def exitCodeMismatch = false for (int i = 0; i < times; i++) { ExecResult execResult = project.execute { @@ -307,9 +306,6 @@ abstract class KonanTest extends JavaExec { ignoreExitValue = true } - def currentResult = out.toString("UTF-8") - println(currentResult) - result += currentResult exitCodeMismatch |= execResult.exitValue != expectedExitStatus if (exitCodeMismatch) { @@ -317,11 +313,12 @@ abstract class KonanTest extends JavaExec { if (this.expectedFail) { println("Expected failure. $message") } else { - throw new TestFailedException("Test failed on iteration $i. $message") + throw new TestFailedException("Test failed on iteration $i. $message\n ${out.toString("UTF-8")}") } } } - + def result = compilerMessagesText + out.toString("UTF-8") + println(result) result = result.replace(System.lineSeparator(), "\n") def goldValueMismatch = !outputChecker.apply(result) if (goldValueMismatch) {