Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to override verbose from command line #341

Merged
merged 2 commits into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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