diff --git a/src/funcTest/groovy/info/solidsoft/gradle/pitest/functional/OverridePluginFunctionalSpec.groovy b/src/funcTest/groovy/info/solidsoft/gradle/pitest/functional/OverridePluginFunctionalSpec.groovy index d85067f7..394b7c2f 100644 --- a/src/funcTest/groovy/info/solidsoft/gradle/pitest/functional/OverridePluginFunctionalSpec.groovy +++ b/src/funcTest/groovy/info/solidsoft/gradle/pitest/functional/OverridePluginFunctionalSpec.groovy @@ -80,4 +80,20 @@ class OverridePluginFunctionalSpec extends AbstractPitestFunctionalSpec { result.standardOutput.contains("--targetTests=$overriddenTargetTests") } + void "should allow to enable verbose output from command line"() { + given: + buildFile << """ + ${getBasicGradlePitestConfig()} + + pitest { + failWhenNoMutations = false + verbose = false + } + """.stripIndent() + when: + ExecutionResult result = runTasksSuccessfully('pitest', '--verbose') + then: + result.standardOutput.contains("--verbose=true") + } + } diff --git a/src/main/groovy/info/solidsoft/gradle/pitest/PitestTask.groovy b/src/main/groovy/info/solidsoft/gradle/pitest/PitestTask.groovy index 9108fc73..1cedcc5d 100644 --- a/src/main/groovy/info/solidsoft/gradle/pitest/PitestTask.groovy +++ b/src/main/groovy/info/solidsoft/gradle/pitest/PitestTask.groovy @@ -249,6 +249,12 @@ class PitestTask extends JavaExec { @Optional List overriddenTargetTests //should be Set or SetProperty but it's not supported in Gradle as of 5.6.1 + @Incubating + @Option(option = "verbose", description = "Output verbose logging. Overrides 'verbose' defined in configuration") + @Input + @Optional + Boolean overriddenVerbose + @Internal File rootDir @@ -358,7 +364,7 @@ class PitestTask extends JavaExec { map['excludedClasses'] = optionalCollectionAsString(excludedClasses) map['excludedTestClasses'] = optionalCollectionAsString(excludedTestClasses) map['avoidCallsTo'] = optionalCollectionAsString(avoidCallsTo) - map['verbose'] = optionalPropertyAsString(verbose) + map['verbose'] = overriddenVerbose ? overriddenVerbose.toString() : optionalPropertyAsString(verbose) map['verbosity'] = optionalPropertyAsString(verbosity) map['timeoutFactor'] = optionalPropertyAsString(timeoutFactor) map['timeoutConst'] = optionalPropertyAsString(timeoutConstInMillis)