Setting testLogging.showStandardStreams property always results in "true"


(thomas.wright) #1

I’m having a hard time understanding the behaviour of the following build script (using gradle 1.11) while trying to set the showStandardStreams property for unit test execution. My complete build script is as follows:

apply plugin: 'java'
  test {
   boolean b = false
   println "Property value before set: " + testLogging.showStandardStreams
   testLogging.showStandardStreams = b
    println "Property value after set: " + testLogging.showStandardStreams
}

If you then execute a gradle task (for example, ‘test’), the following output is produced:

Property value before set: false Property value after set: true :compileJava UP-TO-DATE :processResources UP-TO-DATE :classes UP-TO-DATE :compileTestJava UP-TO-DATE :processTestResources UP-TO-DATE :testClasses UP-TO-DATE :test UP-TO-DATE

BUILD SUCCESSFUL

I’ve tried setting the property to have a Boolean type (rather than the intrinsic boolean), and even setting it to itself, but nothing makes a difference: as soon as the property is assigned, it becomes true.

Thanks for any insight,

Tom


(Peter Niederwieser) #2

This is a bug, and I’ve raised GRADLE-3053 to track it. Thanks for the report.