Skip to content

Instantly share code, notes, and snippets.

@BernardNotarianni
Created September 9, 2013 14:49
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BernardNotarianni/6496653 to your computer and use it in GitHub Desktop.
Save BernardNotarianni/6496653 to your computer and use it in GitHub Desktop.
Simple and efficient automatic test runner. Scan when a source file is modified, and then run the test suite, displaying result to the console.
#!/bin/bash
function ctrl_c {
echo "** Trapped CTRL-C"
stop_server
exit
}
# hit ctrl-c to exit the loop
trap ctrl_c INT TERM EXIT
while true; do
clear
# execute tests
./vendor/bin/phpunit
# scan directories src/ and tests/
inotifywait -qqr -e modify -e create -e move -e delete src tests --exclude "\.\#.*"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment