Add RUN_EXERCISES to exercise.sh.
The exercise.sh accepted a SKIP_EXERCISES var for limiting which
exercises run. Sometimes I only want to run one of this. This new
variable make that much easier than having to list every other exercise
as one that should be skipped.
Change-Id: I21d3cc6ead677d25f7697c6cc1fd690cbbbfbdd7
diff --git a/exercise.sh b/exercise.sh
index 5b3c56e..3516738 100755
--- a/exercise.sh
+++ b/exercise.sh
@@ -17,9 +17,19 @@
# to refrain from exercising euca.sh use SKIP_EXERCISES=euca
SKIP_EXERCISES=${SKIP_EXERCISES:-""}
-# Locate the scripts we should run
-EXERCISE_DIR=$(dirname "$0")/exercises
-basenames=$(for b in `ls $EXERCISE_DIR/*.sh`; do basename $b .sh; done)
+# comma separated list of script basenames to run
+# to run only euca.sh use RUN_EXERCISES=euca
+basenames=${RUN_EXERCISES:-""}
+
+EXERCISE_DIR=$TOP_DIR/exercises
+
+if [ -z "${basenames}" ] ; then
+ # Locate the scripts we should run
+ basenames=$(for b in `ls $EXERCISE_DIR/*.sh`; do basename $b .sh; done)
+else
+ # If RUN_EXERCISES was specified, ignore SKIP_EXERCISES.
+ SKIP_EXERCISES=
+fi
# Track the state of each script
passes=""