Gradle: How to get output from test STDERR/STDOUT into console?

后端 未结 2 1060
[愿得一人]
[愿得一人] 2020-12-13 08:31

(Gradle 3.2.1) I run some java tests, which logs output in Stderr/Stdout. I can see that output, if I start

gradle test --info

but in that

2条回答
  •  遥遥无期
    2020-12-13 09:07

    For those using Kotlin/Kotlin DSL for Gradle, you need to put the following in your build.gradle.kts file:

    tasks.withType {
        this.testLogging {
            this.showStandardStreams = true
        }
    }
    

    Also as mentioned in another answer, you will need to run gradle clean test for the output to print every time.

提交回复
热议问题