Added dry run option

This commit is contained in:
Erik C. Thauvin 2024-12-16 09:24:20 -08:00
parent 2412c525dd
commit 6243355364
Signed by: erik
GPG key ID: 776702A6A2DA330E
3 changed files with 19 additions and 0 deletions

View file

@ -283,6 +283,23 @@ public class PitestOperation extends AbstractProcessOperation<PitestOperation> {
return this; return this;
} }
/**
* Whether to run in dry run mode.
* <p>
* Defaults to {@code false}
*
* @param isDryRun {@code true} or {@code false}
* @return this operation instance
*/
public PitestOperation dryRun(boolean isDryRun) {
if (isDryRun) {
options_.put("--dryRun", TRUE);
} else {
options_.put("--dryRun", FALSE);
}
return this;
}
/** /**
* List of globs to match against class names. Matching classes will be excluded from mutation. * List of globs to match against class names. Matching classes will be excluded from mutation.
* *

View file

@ -77,6 +77,7 @@ class PitestOperationTest {
.classPathFile(FOO) .classPathFile(FOO)
.coverageThreshold(0) .coverageThreshold(0)
.detectInlinedCode(false) .detectInlinedCode(false)
.dryRun(false)
.excludedClasses("class") .excludedClasses("class")
.excludedClasses(List.of(FOO, BAR)) .excludedClasses(List.of(FOO, BAR))
.excludedGroups("group") .excludedGroups("group")

View file

@ -4,6 +4,7 @@
--classPathFile --classPathFile
--coverageThreshold --coverageThreshold
--detectInlinedCode --detectInlinedCode
--dryRun
--excludedClasses --excludedClasses
--excludedGroups --excludedGroups
--excludedMethods --excludedMethods