How do I set test.testLogging.showStandardStreams to true from the command line?

There is no built-in way to set build model properties from the command line. You'll have to make the build script query a system or project property that gets passed in via -D or -P, respectively.


Just use environment variables:

test {
    testLogging.showStandardStreams = (System.getenv('PRINTF_DEBUG') != null)
}

Now run your test case like this:

PRINTF_DEBUG=1 ./gradlew test --tests=com.yourspace.yourtest

This will run enable console output and just run one single test case. You often not want to enable console output for the entire test suite because of the noise generated.

Tags:

Gradle