Created
March 9, 2009 02:02
-
-
Save weavejester/76053 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/bash | |
# | |
# Bash script to automatically run a test suite every time a file is modified | |
# in the src or test directories. Plays a sound file to tell the user what's | |
# happening in an unobtrusive fashion. | |
PLAY="mplayer -really-quiet -nolirc" | |
while true; do | |
# Wait until a file has been changed | |
inotifywait -e close_write -e move -e delete -qq -r src test | |
# If git registers a change | |
if git status | grep -q "git add"; then | |
$PLAY $HOME/Sounds/working.wav | |
# Run the unit tests quietly | |
if script/test -o quiet; then | |
$PLAY $HOME/Sounds/pass.wav | |
else | |
$PLAY $HOME/Sounds/fail.wav | |
fi | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment