Skip to content

Instantly share code, notes, and snippets.

@BraedonWooding
Created August 2, 2018 07:35
Show Gist options
  • Save BraedonWooding/2d3c33850c639bd80fe4f252a71b7e24 to your computer and use it in GitHub Desktop.
Save BraedonWooding/2d3c33850c639bd80fe4f252a71b7e24 to your computer and use it in GitHub Desktop.
#!/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/*
@BraedonWooding
Copy link
Author

BraedonWooding commented Aug 2, 2018

To install you can just call the following;

wget https://gist.githubusercontent.com/BraedonWooding/2d3c33850c639bd80fe4f252a71b7e24/raw/4866a1c17adf2bf745f429a34a25987c871d2c0c/test.sh && chmod +rwx test.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment