Minor: print subprocess output immediately in tests
This commit is contained in:
+6
-3
@@ -28,11 +28,14 @@ fun runProcess(cmd: List<String>, workingDir: File): ProcessRunResult {
|
|||||||
|
|
||||||
val process = builder.start()
|
val process = builder.start()
|
||||||
// important to read inputStream, otherwise the process may hang on some systems
|
// important to read inputStream, otherwise the process may hang on some systems
|
||||||
val output = process.inputStream!!.bufferedReader().readText()
|
val sb = StringBuilder()
|
||||||
System.out.println(output)
|
process.inputStream!!.bufferedReader().forEachLine {
|
||||||
|
System.out.println(it)
|
||||||
|
sb.appendln(it)
|
||||||
|
}
|
||||||
val exitCode = process.waitFor()
|
val exitCode = process.waitFor()
|
||||||
|
|
||||||
return ProcessRunResult(cmd, workingDir, exitCode, output)
|
return ProcessRunResult(cmd, workingDir, exitCode, sb.toString())
|
||||||
}
|
}
|
||||||
|
|
||||||
fun createGradleCommand(tailParameters: List<String>): List<String> {
|
fun createGradleCommand(tailParameters: List<String>): List<String> {
|
||||||
|
|||||||
Reference in New Issue
Block a user