Skip to content

Instantly share code, notes, and snippets.

@meddulla
Created March 23, 2010 03:38
Show Gist options
  • Save meddulla/340817 to your computer and use it in GitHub Desktop.
Save meddulla/340817 to your computer and use it in GitHub Desktop.
#!/bin/sh
# Run all cucumber tests in app cucumber/features directory every n seconds
# Usage
# ./autotest.sh <loop time seconds>
# ./autotest.sh 15
# assumes test is in cucumber/features
# and cucumber dir in same dir as this file
check() {
for="$1"
while true
do
echo `cucumber cucumber/features -f progress`
echo '\n'
sleep $for
done
}
check $*
#!/bin/sh
# Run all cucumber tests in app cucumber/features directory every n seconds
# Plays sound on error using say and print green success on sucess
# Usage
# ./autotest.sh <loop time seconds>
# ./autotest.sh 60
# assumes test is in cucumber/features
# and cucumber dir in same dir as this file
# interrupt with ctrl+c
check() {
for="$1"
while true
do
res=`cucumber cucumber/features -f progress`
if [[ $res == *failed* ]]; then
echo $res
say error
else
echo '\E[47;32m'"\033[1msuccess\033[0m"
fi
echo '\n'
sleep $for
done
}
check $*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment