Minor: print subprocess output immediately in tests

This commit is contained in:
Alexey Tsvetkov
2016-03-23 22:54:25 +03:00
parent da3897536a
commit c686c7fb91
@@ -28,11 +28,14 @@ fun runProcess(cmd: List<String>, workingDir: File): ProcessRunResult {
val process = builder.start()
// important to read inputStream, otherwise the process may hang on some systems
val output = process.inputStream!!.bufferedReader().readText()
System.out.println(output)
val sb = StringBuilder()
process.inputStream!!.bufferedReader().forEachLine {
System.out.println(it)
sb.appendln(it)
}
val exitCode = process.waitFor()
return ProcessRunResult(cmd, workingDir, exitCode, output)
return ProcessRunResult(cmd, workingDir, exitCode, sb.toString())
}
fun createGradleCommand(tailParameters: List<String>): List<String> {