Build change: don't fail when error output has only one line
This commit is contained in:
parent
a6b54925ba
commit
2bcb9ad885
12
build.gradle
12
build.gradle
|
@ -7,6 +7,7 @@ buildscript {
|
||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def printOutput(def output) {
|
def printOutput(def output) {
|
||||||
return tasks.create("printOutput") {
|
return tasks.create("printOutput") {
|
||||||
for (line in output.toString().readLines()) {
|
for (line in output.toString().readLines()) {
|
||||||
|
@ -14,6 +15,7 @@ def printOutput(def output) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
allprojects {
|
allprojects {
|
||||||
apply plugin: 'java'
|
apply plugin: 'java'
|
||||||
apply plugin: 'kotlin'
|
apply plugin: 'kotlin'
|
||||||
|
@ -92,9 +94,11 @@ sourceSets {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static def isTaskDir(File dir) {
|
static def isTaskDir(File dir) {
|
||||||
return new File(dir, "src").exists()
|
return new File(dir, "src").exists()
|
||||||
}
|
}
|
||||||
|
|
||||||
mainClassName = project.hasProperty("mainClass") ? project.getProperty("mainClass") : ""
|
mainClassName = project.hasProperty("mainClass") ? project.getProperty("mainClass") : ""
|
||||||
test {
|
test {
|
||||||
outputs.upToDateWhen { false }
|
outputs.upToDateWhen { false }
|
||||||
|
@ -103,11 +107,13 @@ test {
|
||||||
def message = result.exception?.message ?: "Wrong answer"
|
def message = result.exception?.message ?: "Wrong answer"
|
||||||
def lines = message.readLines()
|
def lines = message.readLines()
|
||||||
println "#educational_plugin FAILED + " + lines[0]
|
println "#educational_plugin FAILED + " + lines[0]
|
||||||
lines[1..-1].forEach { line ->
|
if (lines.size() > 1) {
|
||||||
println "#educational_plugin" + line
|
lines[1..-1].forEach { line ->
|
||||||
|
println "#educational_plugin" + line
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// we need this to separate output of different tests
|
// we need this to separate output of different tests
|
||||||
println
|
println ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue