Skip to content

Commit

Permalink
Double-minus not required, and not recognized.
Browse files Browse the repository at this point in the history
  • Loading branch information
kaby76 committed Oct 9, 2024
1 parent 436c976 commit 580ce65
Show file tree
Hide file tree
Showing 33 changed files with 151 additions and 102 deletions.
4 changes: 2 additions & 2 deletions src/trgen/templates/Antlr4ng/st.perf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ IFS=$(echo -en "\n\b")
# Get a list of test files from the test directory. Do not include any
# .errors or .tree files. Pay close attention to remove only file names
# that end with the suffix .errors or .tree.
files2=`dotnet trglob -- '../<example_files_unix>' | grep -v '.errors$' | grep -v '.tree$'`
files2=`dotnet trglob '../<example_files_unix>' | grep -v '.errors$' | grep -v '.tree$'`
files=()
for f in $files2
do
if [ -d "$f" ]; then continue; fi
dotnet triconv -- -f utf-8 $f > /dev/null 2>&1
dotnet triconv -f utf-8 $f > /dev/null 2>&1
if [ "$?" = "0" ]
then
files+=( $f )
Expand Down
8 changes: 4 additions & 4 deletions src/trgen/templates/Antlr4ng/st.test.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ if (Test-Path -Path "tests.txt" -PathType Leaf) {
Remove-Item "tests.txt"
}
$files = New-Object System.Collections.Generic.List[string]
$allFiles = $(& dotnet trglob -- "$Tests" ; $last = $LASTEXITCODE )
$allFiles = $(& dotnet trglob "$Tests" ; $last = $LASTEXITCODE )
foreach ($file in $allFiles) {
$ext = $file | Split-Path -Extension
if (Test-Path $file -PathType Container) {
Expand All @@ -20,7 +20,7 @@ foreach ($file in $allFiles) {
} elseif ($ext -eq ".tree") {
continue
} else {
$(& dotnet triconv -- -f utf-8 $file ; $last = $LASTEXITCODE ) | Out-Null
$(& dotnet triconv -f utf-8 $file ; $last = $LASTEXITCODE ) | Out-Null
if ($last -ne 0)
{
continue
Expand All @@ -40,10 +40,10 @@ if (-not(Test-Path -Path "tests.txt" -PathType Leaf)) {
# Parse all input files.
<if(individual_parsing)>
# Individual parsing.
Get-Content "tests.txt" | ForEach-Object { dotnet trwdog -- pwsh -command "npx tsx Test.js -q -tee -tree $_" *>> parse.txt }
Get-Content "tests.txt" | ForEach-Object { dotnet trwdog pwsh -command "npx tsx Test.js -q -tee -tree $_" *>> parse.txt }
<else>
# Group parsing.
get-content "tests.txt" | dotnet trwdog -- pwsh -command "npx tsx Test.js -q -x -tee -tree" *> parse.txt
get-content "tests.txt" | dotnet trwdog pwsh -command "npx tsx Test.js -q -x -tee -tree" *> parse.txt
$status=$LASTEXITCODE
<endif>

Expand Down
6 changes: 3 additions & 3 deletions src/trgen/templates/Antlr4ng/st.test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ IFS=$(echo -en "\n\b")
# Get a list of test files from the test directory. Do not include any
# .errors or .tree files. Pay close attention to remove only file names
# that end with the suffix .errors or .tree.
files2=`dotnet trglob -- '../<example_files_unix>' | grep -v '.errors$' | grep -v '.tree$'`
files2=`dotnet trglob '../<example_files_unix>' | grep -v '.errors$' | grep -v '.tree$'`
files=()
for f in $files2
do
Expand All @@ -36,7 +36,7 @@ fi
rm -f parse.txt
for f in ${files[*]}
do
dotnet trwdog -- sh -c "npx tsx Test.js -q -tee -tree $f" >> parse.txt 2>&1
dotnet trwdog sh -c "npx tsx Test.js -q -tee -tree $f" >> parse.txt 2>&1
xxx="$?"
if [ "$xxx" -ne 0 ]
then
Expand All @@ -45,7 +45,7 @@ do
done
<else>
# Group parsing.
echo "${files[*]}" | dotnet trwdog -- sh -c "npx tsx Test.js -q -x -tee -tree" > parse.txt 2>&1
echo "${files[*]}" | dotnet trwdog sh -c "npx tsx Test.js -q -x -tee -tree" > parse.txt 2>&1
status="$?"
<endif>

Expand Down
4 changes: 2 additions & 2 deletions src/trgen/templates/CSharp/st.perf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ IFS=$(echo -en "\n\b")
# Get a list of test files from the test directory. Do not include any
# .errors or .tree files. Pay close attention to remove only file names
# that end with the suffix .errors or .tree.
files2=`dotnet trglob -- '../<example_files_unix>' | grep -v '.errors$' | grep -v '.tree$'`
files2=`dotnet trglob '../<example_files_unix>' | grep -v '.errors$' | grep -v '.tree$'`
files=()
for f in $files2
do
if [ -d "$f" ]; then continue; fi
dotnet triconv -- -f utf-8 $f > /dev/null 2>&1
dotnet triconv -f utf-8 $f > /dev/null 2>&1
if [ "$?" = "0" ]
then
files+=( $f )
Expand Down
49 changes: 49 additions & 0 deletions src/trgen/templates/CSharp/st.test-ambiguity.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Generated from trgen <version>

SAVEIFS=$IFS
IFS=$(echo -en "\n\b")

# Get a list of test files from the test directory. Do not include any
# .errors or .tree files. Pay close attention to remove only file names
# that end with the suffix .errors or .tree.
files2=`dotnet trglob '../<example_files_unix>' | grep -v '.errors$' | grep -v '.tree$'`
files=()
for f in $files2
do
if [ -d "$f" ]; then continue; fi
dotnet triconv -f utf-8 $f > /dev/null 2>&1
if [ "$?" = "0" ]
then
files+=( $f )
fi
done

# People often specify a test file directory, but sometimes no
# tests are provided. Git won't check in an empty directory.
# Test if there are no test files.
if [ ${#files[@]} -eq 0 ]
then
echo "No test cases provided."
exit 0
fi

# Parse all input files.
<if(individual_parsing)>
# Individual parsing: NOT SUPPORTED!
<else>
# Group parsing.
echo "${files[*]}" | dotnet trwdog dotnet trperf -x -c ar | grep -v '^0' | awk '{print $2}' | sort -u
status=$?
<endif>

# trwdog returns 255 if it cannot spawn the process. This could happen
# if the environment for running the program does not exist, or the
# program did not build.
if [ "$status" = "255" ]
then
echo "Test failed."
exit 1
fi

rm -f $old/updated.txt $old/new_errors2.txt $old/new_errors.txt
exit 0
6 changes: 3 additions & 3 deletions src/trgen/templates/CSharp/st.test-cover.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ IFS=$(echo -en "\n\b")
# Get a list of test files from the test directory. Do not include any
# .errors or .tree files. Pay close attention to remove only file names
# that end with the suffix .errors or .tree.
files2=`dotnet trglob -- '../<example_files_unix>' | grep -v '.errors$' | grep -v '.tree$'`
files2=`dotnet trglob '../<example_files_unix>' | grep -v '.errors$' | grep -v '.tree$'`
files=()
for f in $files2
do
if [ -d "$f" ]; then continue; fi
dotnet triconv -- -f utf-8 $f > /dev/null 2>&1
dotnet triconv -f utf-8 $f > /dev/null 2>&1
if [ "$?" = "0" ]
then
files+=( $f )
Expand All @@ -32,7 +32,7 @@ fi
# Individual parsing: NOT SUPPORTED!
<else>
# Group parsing.
echo "${files[*]}" | dotnet trwdog -- dotnet trcover -- -x
echo "${files[*]}" | dotnet trwdog dotnet trcover -x
status=$?
<endif>

Expand Down
8 changes: 4 additions & 4 deletions src/trgen/templates/CSharp/st.test.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ if (Test-Path -Path "tests.txt" -PathType Leaf) {
Remove-Item "tests.txt"
}
$files = New-Object System.Collections.Generic.List[string]
$allFiles = $(& dotnet trglob -- "$Tests" ; $last = $LASTEXITCODE )
$allFiles = $(& dotnet trglob "$Tests" ; $last = $LASTEXITCODE )
foreach ($file in $allFiles) {
$ext = $file | Split-Path -Extension
if (Test-Path $file -PathType Container) {
Expand All @@ -20,7 +20,7 @@ foreach ($file in $allFiles) {
} elseif ($ext -eq ".tree") {
continue
} else {
$(& dotnet triconv -- -f utf-8 $file ; $last = $LASTEXITCODE ) | Out-Null
$(& dotnet triconv -f utf-8 $file ; $last = $LASTEXITCODE ) | Out-Null
if ($last -ne 0)
{
continue
Expand All @@ -40,10 +40,10 @@ if (-not(Test-Path -Path "tests.txt" -PathType Leaf)) {
# Parse all input files.
<if(individual_parsing)>
# Individual parsing.
Get-Content "tests.txt" | ForEach-Object { dotnet trwdog -- ./bin/Debug/net8.0/<if(os_win)>Test.exe<else>Test<endif> -q -tee -tree $_ *>> parse.txt }
Get-Content "tests.txt" | ForEach-Object { dotnet trwdog ./bin/Debug/net8.0/<if(os_win)>Test.exe<else>Test<endif> -q -tee -tree $_ *>> parse.txt }
<else>
# Group parsing.
get-content "tests.txt" | dotnet trwdog -- ./bin/Debug/net8.0/<if(os_win)>Test.exe<else>Test<endif> -q -x -tee -tree *> parse.txt
get-content "tests.txt" | dotnet trwdog ./bin/Debug/net8.0/<if(os_win)>Test.exe<else>Test<endif> -q -x -tee -tree *> parse.txt
$status = $LASTEXITCODE
<endif>

Expand Down
8 changes: 4 additions & 4 deletions src/trgen/templates/CSharp/st.test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ IFS=$(echo -en "\n\b")
# Get a list of test files from the test directory. Do not include any
# .errors or .tree files. Pay close attention to remove only file names
# that end with the suffix .errors or .tree.
files2=`dotnet trglob -- '../<example_files_unix>' | grep -v '.errors$' | grep -v '.tree$'`
files2=`dotnet trglob '../<example_files_unix>' | grep -v '.errors$' | grep -v '.tree$'`
files=()
for f in $files2
do
if [ -d "$f" ]; then continue; fi
dotnet triconv -- -f utf-8 $f > /dev/null 2>&1
dotnet triconv -f utf-8 $f > /dev/null 2>&1
if [ "$?" = "0" ]
then
files+=( $f )
Expand All @@ -36,7 +36,7 @@ fi
rm -f parse.txt
for f in ${files[*]}
do
dotnet trwdog -- ./bin/Debug/net8.0/<if(os_win)>Test.exe<else>Test<endif> -q -tee -tree $f >> parse.txt 2>&1
dotnet trwdog ./bin/Debug/net8.0/<if(os_win)>Test.exe<else>Test<endif> -q -tee -tree $f >> parse.txt 2>&1
xxx="$?"
if [ "$xxx" -ne 0 ]
then
Expand All @@ -45,7 +45,7 @@ do
done
<else>
# Group parsing.
echo "${files[*]}" | dotnet trwdog -- ./bin/Debug/net8.0/<if(os_win)>Test.exe<else>Test<endif> -q -x -tee -tree > parse.txt 2>&1
echo "${files[*]}" | dotnet trwdog ./bin/Debug/net8.0/<if(os_win)>Test.exe<else>Test<endif> -q -x -tee -tree > parse.txt 2>&1
status=$?
<endif>

Expand Down
4 changes: 2 additions & 2 deletions src/trgen/templates/Cpp/st.perf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ IFS=$(echo -en "\n\b")
# Get a list of test files from the test directory. Do not include any
# .errors or .tree files. Pay close attention to remove only file names
# that end with the suffix .errors or .tree.
files2=`dotnet trglob -- '../<example_files_unix>' | grep -v '.errors$' | grep -v '.tree$'`
files2=`dotnet trglob '../<example_files_unix>' | grep -v '.errors$' | grep -v '.tree$'`
files=()
for f in $files2
do
if [ -d "$f" ]; then continue; fi
dotnet triconv -- -f utf-8 $f > /dev/null 2>&1
dotnet triconv -f utf-8 $f > /dev/null 2>&1
if [ "$?" = "0" ]
then
files+=( $f )
Expand Down
8 changes: 4 additions & 4 deletions src/trgen/templates/Cpp/st.test.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ if (Test-Path -Path "tests.txt" -PathType Leaf) {
Remove-Item "tests.txt"
}
$files = New-Object System.Collections.Generic.List[string]
$allFiles = $(& dotnet trglob -- "$Tests" ; $last = $LASTEXITCODE )
$allFiles = $(& dotnet trglob "$Tests" ; $last = $LASTEXITCODE )
foreach ($file in $allFiles) {
$ext = $file | Split-Path -Extension
if (Test-Path $file -PathType Container) {
Expand All @@ -20,7 +20,7 @@ foreach ($file in $allFiles) {
} elseif ($ext -eq ".tree") {
continue
} else {
$(& dotnet triconv -- -f utf-8 $file ; $last = $LASTEXITCODE ) | Out-Null
$(& dotnet triconv -f utf-8 $file ; $last = $LASTEXITCODE ) | Out-Null
if ($last -ne 0)
{
continue
Expand All @@ -40,10 +40,10 @@ if (-not(Test-Path -Path "tests.txt" -PathType Leaf)) {
# Parse all input files.
<if(individual_parsing)>
# Individual parsing.
Get-Content "tests.txt" | ForEach-Object { dotnet trwdog -- ./build/<if(os_win)>Release/<endif><exec_name> -q -tee -tree $_ *>> parse.txt }
Get-Content "tests.txt" | ForEach-Object { dotnet trwdog ./build/<if(os_win)>Release/<endif><exec_name> -q -tee -tree $_ *>> parse.txt }
<else>
# Group parsing.
get-content "tests.txt" | dotnet trwdog -- ./build/<if(os_win)>Release/<endif><exec_name> -q -x -tee -tree *> parse.txt
get-content "tests.txt" | dotnet trwdog ./build/<if(os_win)>Release/<endif><exec_name> -q -x -tee -tree *> parse.txt
$status = $LASTEXITCODE
<endif>

Expand Down
8 changes: 4 additions & 4 deletions src/trgen/templates/Cpp/st.test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ IFS=$(echo -en "\n\b")
# Get a list of test files from the test directory. Do not include any
# .errors or .tree files. Pay close attention to remove only file names
# that end with the suffix .errors or .tree.
files2=`dotnet trglob -- '../<example_files_unix>' | grep -v '.errors$' | grep -v '.tree$'`
files2=`dotnet trglob '../<example_files_unix>' | grep -v '.errors$' | grep -v '.tree$'`
files=()
for f in $files2
do
if [ -d "$f" ]; then continue; fi
dotnet triconv -- -f utf-8 $f > /dev/null 2>&1
dotnet triconv -f utf-8 $f > /dev/null 2>&1
if [ "$?" = "0" ]
then
files+=( $f )
Expand All @@ -36,7 +36,7 @@ fi
rm -f parse.txt
for f in ${files[*]}
do
dotnet trwdog -- ./build/<if(os_win)>Release/<endif><exec_name> -q -tee -tree $f >> parse.txt
dotnet trwdog ./build/<if(os_win)>Release/<endif><exec_name> -q -tee -tree $f >> parse.txt
xxx="$?"
if [ "$xxx" -ne 0 ]
then
Expand All @@ -45,7 +45,7 @@ do
done
<else>
# Group parsing.
echo "${files[*]}" | dotnet trwdog -- ./build/<if(os_win)>Release/<endif><exec_name> -q -x -tee -tree > parse.txt 2>&1
echo "${files[*]}" | dotnet trwdog ./build/<if(os_win)>Release/<endif><exec_name> -q -x -tee -tree > parse.txt 2>&1
status="$?"
<endif>

Expand Down
2 changes: 1 addition & 1 deletion src/trgen/templates/Dart/st.perf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ IFS=$(echo -en "\n\b")
# Get a list of test files from the test directory. Do not include any
# .errors or .tree files. Pay close attention to remove only file names
# that end with the suffix .errors or .tree.
files2=`dotnet trglob -- '../<example_files_unix>' | grep -v '.errors$' | grep -v '.tree$'`
files2=`dotnet trglob '../<example_files_unix>' | grep -v '.errors$' | grep -v '.tree$'`
files=()
for f in $files2
do
Expand Down
8 changes: 4 additions & 4 deletions src/trgen/templates/Dart/st.test.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ if (Test-Path -Path "tests.txt" -PathType Leaf) {
Remove-Item "tests.txt"
}
$files = New-Object System.Collections.Generic.List[string]
$allFiles = $(& dotnet trglob -- "$Tests" ; $last = $LASTEXITCODE )
$allFiles = $(& dotnet trglob "$Tests" ; $last = $LASTEXITCODE )
foreach ($file in $allFiles) {
$ext = $file | Split-Path -Extension
if (Test-Path $file -PathType Container) {
Expand All @@ -20,7 +20,7 @@ foreach ($file in $allFiles) {
} elseif ($ext -eq ".tree") {
continue
} else {
$(& dotnet triconv -- -f utf-8 $file ; $last = $LASTEXITCODE ) | Out-Null
$(& dotnet triconv -f utf-8 $file ; $last = $LASTEXITCODE ) | Out-Null
if ($last -ne 0)
{
continue
Expand All @@ -40,10 +40,10 @@ if (-not(Test-Path -Path "tests.txt" -PathType Leaf)) {
# Parse all input files.
<if(individual_parsing)>
# Individual parsing.
Get-Content "tests.txt" | ForEach-Object { dotnet trwdog -- ./Test.exe -q -tee -tree $_ *>> parse.txt }
Get-Content "tests.txt" | ForEach-Object { dotnet trwdog ./Test.exe -q -tee -tree $_ *>> parse.txt }
<else>
# Group parsing.
get-content "tests.txt" | dotnet trwdog -- ./Test.exe -q -x -tee -tree *> parse.txt
get-content "tests.txt" | dotnet trwdog ./Test.exe -q -x -tee -tree *> parse.txt
$status = $LASTEXITCODE
<endif>

Expand Down
8 changes: 4 additions & 4 deletions src/trgen/templates/Dart/st.test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ IFS=$(echo -en "\n\b")
# Get a list of test files from the test directory. Do not include any
# .errors or .tree files. Pay close attention to remove only file names
# that end with the suffix .errors or .tree.
files2=`dotnet trglob -- '../<example_files_unix>' | grep -v '.errors$' | grep -v '.tree$'`
files2=`dotnet trglob '../<example_files_unix>' | grep -v '.errors$' | grep -v '.tree$'`
files=()
for f in $files2
do
if [ -d "$f" ]; then continue; fi
dotnet triconv -- -f utf-8 $f > /dev/null 2>&1
dotnet triconv -f utf-8 $f > /dev/null 2>&1
if [ "$?" = "0" ]
then
files+=( $f )
Expand All @@ -36,7 +36,7 @@ fi
rm -f parse.txt
for f in ${files[*]}
do
dotnet trwdog -- ./Test.exe -q -tee -tree $f >> parse.txt
dotnet trwdog ./Test.exe -q -tee -tree $f >> parse.txt
xxx="$?"
if [ "$xxx" -ne 0 ]
then
Expand All @@ -45,7 +45,7 @@ do
done
<else>
# Group parsing.
echo "${files[*]}" | dotnet trwdog -- ./Test.exe -q -x -tee -tree > parse.txt 2>&1
echo "${files[*]}" | dotnet trwdog ./Test.exe -q -x -tee -tree > parse.txt 2>&1
status=$?
<endif>

Expand Down
4 changes: 2 additions & 2 deletions src/trgen/templates/Go/st.perf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ IFS=$(echo -en "\n\b")
# Get a list of test files from the test directory. Do not include any
# .errors or .tree files. Pay close attention to remove only file names
# that end with the suffix .errors or .tree.
files2=`dotnet trglob -- '../<example_files_unix>' | grep -v '.errors$' | grep -v '.tree$'`
files2=`dotnet trglob '../<example_files_unix>' | grep -v '.errors$' | grep -v '.tree$'`
files=()
for f in $files2
do
if [ -d "$f" ]; then continue; fi
dotnet triconv -- -f utf-8 $f > /dev/null 2>&1
dotnet triconv -f utf-8 $f > /dev/null 2>&1
if [ "$?" = "0" ]
then
files+=( $f )
Expand Down
Loading

0 comments on commit 580ce65

Please sign in to comment.