Skip to content

Commit

Permalink
Execute cliargs script before running tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ethauvin committed May 28, 2024
1 parent ec50e52 commit e6230a3
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 13 deletions.
12 changes: 0 additions & 12 deletions checkcliargs.sh

This file was deleted.

1 change: 1 addition & 0 deletions lib/bld/bld-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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=
Expand Down
12 changes: 12 additions & 0 deletions scripts/checkcliargs.sh
Original file line number Diff line number Diff line change
@@ -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
File renamed without changes.
9 changes: 9 additions & 0 deletions src/bld/java/rife/bld/extension/PitestOperationBuild.java
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,13 @@ public void pmd() {
.ruleSets("config/pmd.xml")
.execute();
}

@Override
public void test() throws Exception {
new ExecOperation()
.fromProject(this)
.command("scripts/cliargs.sh")
.execute();
super.test();
}
}
2 changes: 1 addition & 1 deletion src/test/java/rife/bld/extension/PitestOperationTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ void avoidCallsTo() {
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())
Expand Down

0 comments on commit e6230a3

Please sign in to comment.