Compare commits
2 commits
b6995b05a2
...
e7ed7edc30
Author | SHA1 | Date | |
---|---|---|---|
e7ed7edc30 | |||
ec0998caa4 |
3 changed files with 30 additions and 2 deletions
7
cliargs.sh
Executable file
7
cliargs.sh
Executable file
|
@ -0,0 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
java -cp "lib/test/*" org.pitest.mutationtest.commandline.MutationCoverageReport --help |\
|
||||
grep "^.*--.*" |\
|
||||
sed -e "s/\* --/--/" -e "s/ .*//" -e "s/^--/\"--/" -e "s/$/\",/" |\
|
||||
sort |\
|
||||
sed -e '/testPlugin/d' -e '/--help/d' -e '/---/d' -e '$s/,//'
|
|
@ -592,6 +592,17 @@ public class PitestOperation extends AbstractProcessOperation<PitestOperation> {
|
|||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Maximum number of surviving mutants to allow without throwing an error.
|
||||
*
|
||||
* @param maxMutationsPerClass the max number
|
||||
* @return this operation instance
|
||||
*/
|
||||
public PitestOperation maxMutationsPerClass(int maxMutationsPerClass) {
|
||||
options.put("--maxMutationsPerClass", String.valueOf(maxMutationsPerClass));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Maximum number of surviving mutants to allow without throwing an error.
|
||||
*
|
||||
|
|
|
@ -77,12 +77,13 @@ class PitestOperationTest {
|
|||
"--fullMutationMatrix",
|
||||
"--historyInputLocation",
|
||||
"--historyOutputLocation",
|
||||
"--includeLaunchClasspath",
|
||||
"--includedGroups",
|
||||
"--includedTestMethods",
|
||||
"--includeLaunchClasspath",
|
||||
"--inputEncoding",
|
||||
"--jvmArgs",
|
||||
"--jvmPath",
|
||||
"--maxMutationsPerClass",
|
||||
"--maxSurviving",
|
||||
"--mutableCodePaths",
|
||||
"--mutationEngine",
|
||||
|
@ -122,8 +123,8 @@ class PitestOperationTest {
|
|||
.excludedGroups(List.of(FOO, BAR))
|
||||
.excludedMethods("method")
|
||||
.excludedMethods(List.of(FOO, BAR))
|
||||
.excludedTestClasses("test")
|
||||
.excludedRunners("runners")
|
||||
.excludedTestClasses("test")
|
||||
.exportLineCoverage(true)
|
||||
.failWhenNoMutations(true)
|
||||
.features("feature")
|
||||
|
@ -136,6 +137,7 @@ class PitestOperationTest {
|
|||
.inputEncoding("encoding")
|
||||
.jvmArgs("-XX:+UnlogregckDiagnosticVMOptions")
|
||||
.jvmPath("path")
|
||||
.maxMutationsPerClass(3)
|
||||
.maxSurviving(1)
|
||||
.mutableCodePaths("codePaths")
|
||||
.mutationEngine("engine")
|
||||
|
@ -456,6 +458,14 @@ class PitestOperationTest {
|
|||
assertThat(op.options.get("--jvmPath")).isEqualTo(FOO);
|
||||
}
|
||||
|
||||
@Test
|
||||
void maxMutationsPerClass() {
|
||||
var op = new PitestOperation()
|
||||
.fromProject(new BaseProject())
|
||||
.maxMutationsPerClass(12);
|
||||
assertThat(op.options.get("--maxMutationsPerClass")).isEqualTo("12");
|
||||
}
|
||||
|
||||
@Test
|
||||
void maxSurviving() {
|
||||
var op = new PitestOperation()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue