Todd Willey | 2599b31 | 2011-11-04 10:31:37 -0400 | [diff] [blame^] | 1 | #!/usr/bin/env bash |
| 2 | |
| 3 | # Run everything in the exercises/ directory that isn't explicitly disabled |
| 4 | |
| 5 | # comma separated list of script basenames to skip |
| 6 | # to refrain from exercising euca.sh use SKIP_EXERCISES=euca |
| 7 | SKIP_EXERCISES=${SKIP_EXERCISES:-""} |
| 8 | |
| 9 | EXERCISE_DIR=$(dirname "$0")/exercises |
| 10 | basenames=$(for b in `ls $EXERCISE_DIR/*.sh` ; do basename $b .sh ; done) |
| 11 | |
| 12 | for script in $basenames ; do |
| 13 | if [[ "$SKIP_EXERCISES" =~ $script ]] ; then |
| 14 | echo SKIPPING $script |
| 15 | else |
| 16 | echo Running $script |
| 17 | $EXERCISE_DIR/$script.sh 2> $script.log |
| 18 | if [[ $? -ne 0 ]] ; then |
| 19 | echo FAILED. See $script.log |
| 20 | else |
| 21 | rm $script.log |
| 22 | fi |
| 23 | fi |
| 24 | done |