-
-
Notifications
You must be signed in to change notification settings - Fork 234
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
50 changed files
with
606 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/bin/bash | ||
|
||
# Generate test data for the program | ||
|
||
if [ $# -ne 2 ]; then | ||
echo "Usage: $0 <test name> <test argument>" | ||
exit 1 | ||
fi | ||
|
||
# Clean up previous test data | ||
|
||
if [ -f tests/cmd/"$1".toml ]; then | ||
rm tests/cmd/"$1".toml | ||
fi | ||
|
||
if [ -f tests/cmd/"$1".stdout ]; then | ||
rm tests/cmd/"$1".stdout | ||
fi | ||
|
||
if [ -f tests/cmd/"$1".stderr ]; then | ||
rm tests/cmd/"$1".stderr | ||
fi | ||
|
||
# Generate test data | ||
|
||
touch tests/cmd/"$1".toml | ||
|
||
echo 'bin.name = "eza"' >> tests/cmd/"$1".toml | ||
echo 'args = "'"$2"'"' >> tests/cmd/"$1".toml | ||
|
||
# Generate expected output | ||
|
||
if [ -f target/debug/eza ]; then | ||
target/debug/eza "$2" > tests/cmd/"$1".stdout 2> tests/cmd/"$1".stderr | ||
returncode=$? | ||
if [ $returncode -ne 0 ]; then | ||
echo -e 'status.code = '$returncode'' >> tests/cmd/"$1".toml | ||
exit 0 | ||
fi | ||
else | ||
echo "Please build the program first" | ||
exit 1 | ||
fi |
Oops, something went wrong.