Skip to content

Commit 6243355

Browse files
committed
Added dry run option
1 parent 2412c52 commit 6243355

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

src/main/java/rife/bld/extension/PitestOperation.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,23 @@ public PitestOperation detectInlinedCode(boolean isDetectInlinedCode) {
283283
return this;
284284
}
285285

286+
/**
287+
* Whether to run in dry run mode.
288+
* <p>
289+
* Defaults to {@code false}
290+
*
291+
* @param isDryRun {@code true} or {@code false}
292+
* @return this operation instance
293+
*/
294+
public PitestOperation dryRun(boolean isDryRun) {
295+
if (isDryRun) {
296+
options_.put("--dryRun", TRUE);
297+
} else {
298+
options_.put("--dryRun", FALSE);
299+
}
300+
return this;
301+
}
302+
286303
/**
287304
* List of globs to match against class names. Matching classes will be excluded from mutation.
288305
*

src/test/java/rife/bld/extension/PitestOperationTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ void checkAllParameters() throws IOException {
7777
.classPathFile(FOO)
7878
.coverageThreshold(0)
7979
.detectInlinedCode(false)
80+
.dryRun(false)
8081
.excludedClasses("class")
8182
.excludedClasses(List.of(FOO, BAR))
8283
.excludedGroups("group")

src/test/resources/pitest-args.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
--classPathFile
55
--coverageThreshold
66
--detectInlinedCode
7+
--dryRun
78
--excludedClasses
89
--excludedGroups
910
--excludedMethods

0 commit comments

Comments
 (0)