Skip to content

Commit

Permalink
Add support for testPlugin and failWhenNoMutations to ant plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
mduggan committed Feb 22, 2019
1 parent 79b5ba7 commit 20a95ca
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pitest-ant/src/main/java/org/pitest/ant/PitestTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,10 @@ public void setOutputFormats(final String value) {
this.setOption(ConfigOption.OUTPUT_FORMATS, value);
}

public void setFailWhenNoMutations(final String value) {
this.setOption(ConfigOption.FAIL_WHEN_NOT_MUTATIONS, value);
}

public void setSourceDir(final String value) {
this.setOption(ConfigOption.SOURCE_DIR, value);
}
Expand All @@ -204,6 +208,10 @@ public void setMutableCodePaths(final String glob) {
setOption(ConfigOption.CODE_PATHS, glob);
}

public void setTestPlugin(final String value) {
this.setOption(ConfigOption.TEST_PLUGIN, value);
}

public void setIncludedGroups(final String value) {
this.setOption(ConfigOption.INCLUDED_GROUPS, value);
}
Expand Down
14 changes: 14 additions & 0 deletions pitest-ant/src/test/java/org/pitest/ant/PitestTaskTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,13 @@ public void shouldPassOutputFormatsOptionToJavaTask() {
verify(this.arg).setValue("--outputFormats=XML");
}

@Test
public void shouldPassFailWhenNoMutationsToJavaTask() {
this.pitestTask.setFailWhenNoMutations("true");
this.pitestTask.execute(this.java);
verify(this.arg).setValue("--failWhenNoMutations=true");
}

@Test
public void shouldPassReportDirOptionToJavaTask() {
this.pitestTask.setReportDir("report/");
Expand Down Expand Up @@ -246,6 +253,13 @@ public void shouldPassMutableCodePathsToJavaTask() {
verify(this.arg).setValue("--mutableCodePaths=foo");
}

@Test
public void shouldPassTestPluginToJavaTask() {
this.pitestTask.setTestPlugin("junit");
this.pitestTask.execute(this.java);
verify(this.arg).setValue("--testPlugin=junit");
}

@Test
public void shouldOnlyPassTheSpecifiedOptions() throws Exception {
this.pitestTask.setVerbose("true");
Expand Down

0 comments on commit 20a95ca

Please sign in to comment.