Skip to content

Commit

Permalink
Ability to override from command line (#341)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pfoerd authored Sep 2, 2024
1 parent 92cc7a8 commit 1772a5e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,12 @@ class PitestTask extends JavaExec {
@Optional
List<String> overriddenTargetTests //should be Set<String> 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

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 1772a5e

Please sign in to comment.