Fix output parse
This commit is contained in:
committed by
Pavel Punegov
parent
ce9f2b7c0b
commit
e6a391f024
@@ -2237,8 +2237,8 @@ task multiargs(type: RunStandaloneKonanTest) {
|
|||||||
arguments = ["AAA", "BB", "C"]
|
arguments = ["AAA", "BB", "C"]
|
||||||
multiRuns = true
|
multiRuns = true
|
||||||
multiArguments = [["1", "2", "3"], ["---"], ["Hello", "world"]]
|
multiArguments = [["1", "2", "3"], ["---"], ["Hello", "world"]]
|
||||||
goldValue = "AAA\nBB\nC\n1\n2\n3" +
|
goldValue = "AAA\nBB\nC\n1\n2\n3\n" +
|
||||||
"AAA\nBB\nC\n---" +
|
"AAA\nBB\nC\n---\n" +
|
||||||
"AAA\nBB\nC\nHello\nworld\n"
|
"AAA\nBB\nC\nHello\nworld\n"
|
||||||
source = "runtime/basic/args0.kt"
|
source = "runtime/basic/args0.kt"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -287,7 +287,6 @@ abstract class KonanTest extends JavaExec {
|
|||||||
|
|
||||||
def times = multiRuns ? multiArguments.size() : 1
|
def times = multiRuns ? multiArguments.size() : 1
|
||||||
|
|
||||||
def result = compilerMessagesText
|
|
||||||
def exitCodeMismatch = false
|
def exitCodeMismatch = false
|
||||||
for (int i = 0; i < times; i++) {
|
for (int i = 0; i < times; i++) {
|
||||||
ExecResult execResult = project.execute {
|
ExecResult execResult = project.execute {
|
||||||
@@ -307,9 +306,6 @@ abstract class KonanTest extends JavaExec {
|
|||||||
|
|
||||||
ignoreExitValue = true
|
ignoreExitValue = true
|
||||||
}
|
}
|
||||||
def currentResult = out.toString("UTF-8")
|
|
||||||
println(currentResult)
|
|
||||||
result += currentResult
|
|
||||||
|
|
||||||
exitCodeMismatch |= execResult.exitValue != expectedExitStatus
|
exitCodeMismatch |= execResult.exitValue != expectedExitStatus
|
||||||
if (exitCodeMismatch) {
|
if (exitCodeMismatch) {
|
||||||
@@ -317,11 +313,12 @@ abstract class KonanTest extends JavaExec {
|
|||||||
if (this.expectedFail) {
|
if (this.expectedFail) {
|
||||||
println("Expected failure. $message")
|
println("Expected failure. $message")
|
||||||
} else {
|
} 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")
|
result = result.replace(System.lineSeparator(), "\n")
|
||||||
def goldValueMismatch = !outputChecker.apply(result)
|
def goldValueMismatch = !outputChecker.apply(result)
|
||||||
if (goldValueMismatch) {
|
if (goldValueMismatch) {
|
||||||
|
|||||||
Reference in New Issue
Block a user