Execute cliargs script before running tests

This commit is contained in:
Erik C. Thauvin 2024-05-28 14:27:54 -07:00
parent ec50e5272b
commit e6230a3644
Signed by: erik
GPG key ID: 776702A6A2DA330E
6 changed files with 23 additions and 13 deletions

View file

@ -1,12 +0,0 @@
#!/bin/bash
MAIN="org.pitest.mutationtest.commandline.MutationCoverageReport"
TMPNEW=/tmp/checkcliargs-new
TMPOLD=/tmp/checkcliargs-old
java -cp "lib/test/*" $MAIN --help >$TMPNEW
java -cp "examples/lib/test/*" $MAIN --help >$TMPOLD
diff $TMPOLD $TMPNEW
rm -rf $TMPNEW $TMPOLD

View file

@ -1,6 +1,7 @@
bld.downloadExtensionJavadoc=false
bld.downloadExtensionSources=true
bld.extension-pmd=com.uwyn.rife2:bld-pmd:0.9.9
bld.extension-exec=com.uwyn.rife2:bld-exec:1.0.0
bld.extension-jacoco=com.uwyn.rife2:bld-jacoco-report:0.9.5
bld.repositories=MAVEN_CENTRAL,MAVEN_LOCAL,RIFE2_SNAPSHOTS,RIFE2_RELEASES
bld.downloadLocation=

12
scripts/checkcliargs.sh Executable file
View file

@ -0,0 +1,12 @@
#!/bin/bash
main="org.pitest.mutationtest.commandline.MutationCoverageReport"
new=/tmp/checkcliargs-new
old=/tmp/checkcliargs-old
java -cp "lib/test/*" $main --help >$new
java -cp "examples/lib/test/*" $main --help >$old
diff $old $new
rm -rf $new $old

View file

@ -108,4 +108,13 @@ public class PitestOperationBuild extends Project {
.ruleSets("config/pmd.xml")
.execute();
}
@Override
public void test() throws Exception {
new ExecOperation()
.fromProject(this)
.command("scripts/cliargs.sh")
.execute();
super.test();
}
}

View file

@ -62,7 +62,7 @@ class PitestOperationTest {
void checkAllParameters() throws IOException {
var args = Files.readAllLines(Paths.get("src", "test", "resources", "pitest-args.txt"));
assertThat(args).hasSizeGreaterThan(0);
assertThat(args).isNotEmpty();
var params = new PitestOperation()
.fromProject(new BaseProject())