Read arguments from resource file
This commit is contained in:
parent
e7ed7edc30
commit
ec50e5272b
3 changed files with 57 additions and 55 deletions
|
@ -2,6 +2,6 @@
|
||||||
|
|
||||||
java -cp "lib/test/*" org.pitest.mutationtest.commandline.MutationCoverageReport --help |\
|
java -cp "lib/test/*" org.pitest.mutationtest.commandline.MutationCoverageReport --help |\
|
||||||
grep "^.*--.*" |\
|
grep "^.*--.*" |\
|
||||||
sed -e "s/\* --/--/" -e "s/ .*//" -e "s/^--/\"--/" -e "s/$/\",/" |\
|
sed -e "s/\* --/--/" -e "s/ .*//" |\
|
||||||
sort |\
|
sort |\
|
||||||
sed -e '/testPlugin/d' -e '/--help/d' -e '/---/d' -e '$s/,//'
|
sed -e '/testPlugin/d' -e '/--help/d' -e '/---/d' > src/test/resources/pitest-args.txt
|
|
@ -23,6 +23,7 @@ import rife.bld.WebProject;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
|
import java.nio.file.Paths;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
@ -58,58 +59,12 @@ class PitestOperationTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void checkAllParameters() {
|
void checkAllParameters() throws IOException {
|
||||||
var params = List.of(
|
var args = Files.readAllLines(Paths.get("src", "test", "resources", "pitest-args.txt"));
|
||||||
"--argLine",
|
|
||||||
"--avoidCallsTo",
|
|
||||||
"--classPath",
|
|
||||||
"--classPathFile",
|
|
||||||
"--coverageThreshold",
|
|
||||||
"--detectInlinedCode",
|
|
||||||
"--excludedClasses",
|
|
||||||
"--excludedGroups",
|
|
||||||
"--excludedMethods",
|
|
||||||
"--excludedRunners",
|
|
||||||
"--excludedTestClasses",
|
|
||||||
"--exportLineCoverage",
|
|
||||||
"--failWhenNoMutations",
|
|
||||||
"--features",
|
|
||||||
"--fullMutationMatrix",
|
|
||||||
"--historyInputLocation",
|
|
||||||
"--historyOutputLocation",
|
|
||||||
"--includedGroups",
|
|
||||||
"--includedTestMethods",
|
|
||||||
"--includeLaunchClasspath",
|
|
||||||
"--inputEncoding",
|
|
||||||
"--jvmArgs",
|
|
||||||
"--jvmPath",
|
|
||||||
"--maxMutationsPerClass",
|
|
||||||
"--maxSurviving",
|
|
||||||
"--mutableCodePaths",
|
|
||||||
"--mutationEngine",
|
|
||||||
"--mutationThreshold",
|
|
||||||
"--mutationUnitSize",
|
|
||||||
"--mutators",
|
|
||||||
"--outputEncoding",
|
|
||||||
"--outputFormats",
|
|
||||||
"--pluginConfiguration",
|
|
||||||
"--projectBase",
|
|
||||||
"--reportDir",
|
|
||||||
"--skipFailingTests",
|
|
||||||
"--sourceDirs",
|
|
||||||
"--targetClasses",
|
|
||||||
"--targetTests",
|
|
||||||
"--testStrengthThreshold",
|
|
||||||
"--threads",
|
|
||||||
"--timeoutConst",
|
|
||||||
"--timeoutFactor",
|
|
||||||
"--timestampedReports",
|
|
||||||
"--useClasspathJar",
|
|
||||||
"--verbose",
|
|
||||||
"--verbosity"
|
|
||||||
);
|
|
||||||
|
|
||||||
var args = new PitestOperation()
|
assertThat(args).hasSizeGreaterThan(0);
|
||||||
|
|
||||||
|
var params = new PitestOperation()
|
||||||
.fromProject(new BaseProject())
|
.fromProject(new BaseProject())
|
||||||
.argLine(FOO)
|
.argLine(FOO)
|
||||||
.avoidCallsTo(FOO, BAR)
|
.avoidCallsTo(FOO, BAR)
|
||||||
|
@ -162,9 +117,9 @@ class PitestOperationTest {
|
||||||
.verbosity("default")
|
.verbosity("default")
|
||||||
.executeConstructProcessCommandList();
|
.executeConstructProcessCommandList();
|
||||||
|
|
||||||
for (var p : params) {
|
for (var p : args) {
|
||||||
var found = false;
|
var found = false;
|
||||||
for (var a : args) {
|
for (var a : params) {
|
||||||
if (a.startsWith(p)) {
|
if (a.startsWith(p)) {
|
||||||
found = true;
|
found = true;
|
||||||
break;
|
break;
|
||||||
|
|
47
src/test/resources/pitest-args.txt
Normal file
47
src/test/resources/pitest-args.txt
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
--argLine
|
||||||
|
--avoidCallsTo
|
||||||
|
--classPath
|
||||||
|
--classPathFile
|
||||||
|
--coverageThreshold
|
||||||
|
--detectInlinedCode
|
||||||
|
--excludedClasses
|
||||||
|
--excludedGroups
|
||||||
|
--excludedMethods
|
||||||
|
--excludedRunners
|
||||||
|
--excludedTestClasses
|
||||||
|
--exportLineCoverage
|
||||||
|
--failWhenNoMutations
|
||||||
|
--features
|
||||||
|
--fullMutationMatrix
|
||||||
|
--historyInputLocation
|
||||||
|
--historyOutputLocation
|
||||||
|
--includedGroups
|
||||||
|
--includedTestMethods
|
||||||
|
--includeLaunchClasspath
|
||||||
|
--inputEncoding
|
||||||
|
--jvmArgs
|
||||||
|
--jvmPath
|
||||||
|
--maxMutationsPerClass
|
||||||
|
--maxSurviving
|
||||||
|
--mutableCodePaths
|
||||||
|
--mutationEngine
|
||||||
|
--mutationThreshold
|
||||||
|
--mutationUnitSize
|
||||||
|
--mutators
|
||||||
|
--outputEncoding
|
||||||
|
--outputFormats
|
||||||
|
--pluginConfiguration
|
||||||
|
--projectBase
|
||||||
|
--reportDir
|
||||||
|
--skipFailingTests
|
||||||
|
--sourceDirs
|
||||||
|
--targetClasses
|
||||||
|
--targetTests
|
||||||
|
--testStrengthThreshold
|
||||||
|
--threads
|
||||||
|
--timeoutConst
|
||||||
|
--timeoutFactor
|
||||||
|
--timestampedReports
|
||||||
|
--useClasspathJar
|
||||||
|
--verbose
|
||||||
|
--verbosity
|
Loading…
Add table
Add a link
Reference in a new issue