Created
June 24, 2015 15:13
-
-
Save fsaravia/9a2c63c0063d99c80964 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#! /usr/bin/env bash | |
export PROTEST_REPORT=summary | |
export PROTEST_FAIL_EARLY=true | |
find_command() { | |
find ./test -name "*.rb" -mindepth 2 | |
} | |
NUMBER_OF_FILES=$(echo `find_command | wc -l`) | |
RESULTS_FILE=last_results.txt | |
cleanup() { | |
if [[ -e $RESULTS_FILE ]]; then | |
rm $RESULTS_FILE | |
fi | |
} | |
cancel() { | |
cleanup | |
exit 0 | |
} | |
trap cancel SIGINT | |
for file in `find_command`; do | |
((i++)) | |
echo "Testing $file ($i/$NUMBER_OF_FILES)" | |
ruby $file > $RESULTS_FILE | |
if [[ $? != 0 ]]; then | |
echo "Test failed" | |
cat last_results.txt | |
break | |
fi | |
done | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Using Bash arrays FTW!