diff --git a/src/main/java/rife/bld/extension/PitestOperation.java b/src/main/java/rife/bld/extension/PitestOperation.java index eb6c5c7..f619c38 100644 --- a/src/main/java/rife/bld/extension/PitestOperation.java +++ b/src/main/java/rife/bld/extension/PitestOperation.java @@ -283,6 +283,23 @@ public class PitestOperation extends AbstractProcessOperation { return this; } + /** + * Whether to run in dry run mode. + *

+ * 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. * diff --git a/src/test/java/rife/bld/extension/PitestOperationTest.java b/src/test/java/rife/bld/extension/PitestOperationTest.java index d301eb0..5bb4ea2 100644 --- a/src/test/java/rife/bld/extension/PitestOperationTest.java +++ b/src/test/java/rife/bld/extension/PitestOperationTest.java @@ -77,6 +77,7 @@ class PitestOperationTest { .classPathFile(FOO) .coverageThreshold(0) .detectInlinedCode(false) + .dryRun(false) .excludedClasses("class") .excludedClasses(List.of(FOO, BAR)) .excludedGroups("group") diff --git a/src/test/resources/pitest-args.txt b/src/test/resources/pitest-args.txt index 348f16e..df24bfb 100644 --- a/src/test/resources/pitest-args.txt +++ b/src/test/resources/pitest-args.txt @@ -4,6 +4,7 @@ --classPathFile --coverageThreshold --detectInlinedCode +--dryRun --excludedClasses --excludedGroups --excludedMethods