Cleaned up cliargs script

This commit is contained in:
Erik C. Thauvin 2024-05-27 22:51:12 -07:00
parent 0a869da1d5
commit cd34bb182c
Signed by: erik
GPG key ID: 776702A6A2DA330E
2 changed files with 3 additions and 7 deletions

View file

@ -1,15 +1,9 @@
#!/bin/bash #!/bin/bash
MAIN="org.testng.TestNG" java -cp "lib/test/*" org.testng.TestNG 2>/dev/null |\
TMP=/tmp/cliargs
java -cp "lib/test/*" $MAIN >$TMP 2>/dev/null
cat $TMP |\
grep "^ -.*" |\ grep "^ -.*" |\
sed -e "s/ -/-/" -e "s/, -/\n-/" |\ sed -e "s/ -/-/" -e "s/, -/\n-/" |\
sed "/testRunFactory/d" |\ sed "/testRunFactory/d" |\
sort |\ sort |\
sed '$s/,//' > "src/test/resources/testng-args.txt" sed '$s/,//' > "src/test/resources/testng-args.txt"
rm -rf $TMP

View file

@ -53,6 +53,8 @@ class TestNgOperationTest {
void testCheckAllParameters() throws IOException { void testCheckAllParameters() throws IOException {
var args = Files.readAllLines(Paths.get("src", "test", "resources", "testng-args.txt")); var args = Files.readAllLines(Paths.get("src", "test", "resources", "testng-args.txt"));
assertThat(args).isNotEmpty();
var params = new TestNgOperation() var params = new TestNgOperation()
.fromProject(new BaseProjectBlueprint(new File("examples"), "com.example", "Examples")) .fromProject(new BaseProjectBlueprint(new File("examples"), "com.example", "Examples"))
.alwaysRunListeners(true) .alwaysRunListeners(true)