Permalink
Browse files

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
  • Loading branch information...
1 parent 8738759 commit a845ddedfc61b3654963925d28333ac713850b85 @russellb russellb committed Mar 7, 2013
Showing with 13 additions and 3 deletions.
  1. +13 −3 exercise.sh
View
@@ -17,9 +17,19 @@ source $TOP_DIR/stackrc
# 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=""

0 comments on commit a845dde

Please sign in to comment.