Execute cliargs script before running tests

This commit is contained in:
Erik C. Thauvin 2024-05-28 14:01:45 -07:00
parent 7aa0319d4d
commit aa6d6a70b0
Signed by: erik
GPG key ID: 776702A6A2DA330E
6 changed files with 31 additions and 21 deletions

View file

@ -104,4 +104,13 @@ public class CheckstyleOperationBuild 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

@ -46,11 +46,11 @@ class CheckstyleOperationTest {
@Test
void checkAllParameters() throws IOException {
var params = Files.readAllLines(Paths.get("src", "test", "resources", "checkstyle-args.txt"));
var args = Files.readAllLines(Paths.get("src", "test", "resources", "checkstyle-args.txt"));
assertThat(params).isNotEmpty();
assertThat(args).isNotEmpty();
var args = new CheckstyleOperation()
var params = new CheckstyleOperation()
.fromProject(new Project())
.branchMatchingXpath("xpath")
.configurationFile("config")
@ -70,9 +70,9 @@ class CheckstyleOperationTest {
.treeWithJavadoc(true)
.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;