blob: de906f25e524b43e5636e7e57dd5d5ce8e797c44 [file] [log] [blame]
Todd Willey2599b312011-11-04 10:31:37 -04001#!/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
7SKIP_EXERCISES=${SKIP_EXERCISES:-""}
8
9EXERCISE_DIR=$(dirname "$0")/exercises
10basenames=$(for b in `ls $EXERCISE_DIR/*.sh` ; do basename $b .sh ; done)
11
12for 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
24done