Created
August 2, 2018 07:35
-
-
Save BraedonWooding/2d3c33850c639bd80fe4f252a71b7e24 to your computer and use it in GitHub Desktop.
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
#!/bin/sh | |
# Just a small bash script to run for all files under tests that end in .test | |
# To add execute permissions make sure you call `chmod +rwx test.sh` | |
if [ ! -d "tests/bin" ]; then | |
echo "Creating bin folder under tests/bin" | |
cd tests && mkdir bin | |
fi | |
for file in $(cd tests && ls); do | |
if [ $file = '*.test' ]; then | |
# Do file work | |
filename="${file##*/}" | |
echo == Test $filename == | |
sort -n < tests/$file > tests/bin/{$filename}_expected | |
./usel < tests/$file > tests/bin/{$filename}_observed | |
diff tests/bin/{$filename}_expected tests/bin/{$filename}_observed | |
fi | |
done | |
rm tests/bin/* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To install you can just call the following;
wget https://gist.githubusercontent.com/BraedonWooding/2d3c33850c639bd80fe4f252a71b7e24/raw/4866a1c17adf2bf745f429a34a25987c871d2c0c/test.sh && chmod +rwx test.sh