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 |\
|
||||
grep "^.*--.*" |\
|
||||
sed -e "s/\* --/--/" -e "s/ .*//" -e "s/^--/\"--/" -e "s/$/\",/" |\
|
||||
sed -e "s/\* --/--/" -e "s/ .*//" |\
|
||||
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.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
|
@ -58,58 +59,12 @@ class PitestOperationTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
void checkAllParameters() {
|
||||
var params = List.of(
|
||||
"--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"
|
||||
);
|
||||
void checkAllParameters() throws IOException {
|
||||
var args = Files.readAllLines(Paths.get("src", "test", "resources", "pitest-args.txt"));
|
||||
|
||||
var args = new PitestOperation()
|
||||
assertThat(args).hasSizeGreaterThan(0);
|
||||
|
||||
var params = new PitestOperation()
|
||||
.fromProject(new BaseProject())
|
||||
.argLine(FOO)
|
||||
.avoidCallsTo(FOO, BAR)
|
||||
|
@ -162,9 +117,9 @@ class PitestOperationTest {
|
|||
.verbosity("default")
|
||||
.executeConstructProcessCommandList();
|
||||
|
||||
for (var p : params) {
|
||||
for (var p : args) {
|
||||
var found = false;
|
||||
for (var a : args) {
|
||||
for (var a : params) {
|
||||
if (a.startsWith(p)) {
|
||||
found = true;
|
||||
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