diff --git a/cliargs.sh b/cliargs.sh index d5fccfd..2f86041 100755 --- a/cliargs.sh +++ b/cliargs.sh @@ -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/,//' \ No newline at end of file +sed -e '/testPlugin/d' -e '/--help/d' -e '/---/d' > src/test/resources/pitest-args.txt \ No newline at end of file diff --git a/src/test/java/rife/bld/extension/PitestOperationTest.java b/src/test/java/rife/bld/extension/PitestOperationTest.java index 63a27f6..e71e6e2 100644 --- a/src/test/java/rife/bld/extension/PitestOperationTest.java +++ b/src/test/java/rife/bld/extension/PitestOperationTest.java @@ -23,6 +23,7 @@ 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 @@ void avoidCallsTo() { } @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" - ); - - var args = new PitestOperation() + void checkAllParameters() throws IOException { + var args = Files.readAllLines(Paths.get("src", "test", "resources", "pitest-args.txt")); + + assertThat(args).hasSizeGreaterThan(0); + + var params = new PitestOperation() .fromProject(new BaseProject()) .argLine(FOO) .avoidCallsTo(FOO, BAR) @@ -162,9 +117,9 @@ void checkAllParameters() { .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; diff --git a/src/test/resources/pitest-args.txt b/src/test/resources/pitest-args.txt new file mode 100644 index 0000000..348f16e --- /dev/null +++ b/src/test/resources/pitest-args.txt @@ -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