Browse code

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

Russell Bryant authored on 2013/03/08 05:16:01
Showing 1 changed files
... ...
@@ -17,9 +17,19 @@ source $TOP_DIR/stackrc
17 17
 # to refrain from exercising euca.sh use SKIP_EXERCISES=euca
18 18
 SKIP_EXERCISES=${SKIP_EXERCISES:-""}
19 19
 
20
-# Locate the scripts we should run
21
-EXERCISE_DIR=$(dirname "$0")/exercises
22
-basenames=$(for b in `ls $EXERCISE_DIR/*.sh`; do basename $b .sh; done)
20
+# comma separated list of script basenames to run
21
+# to run only euca.sh use RUN_EXERCISES=euca
22
+basenames=${RUN_EXERCISES:-""}
23
+
24
+EXERCISE_DIR=$TOP_DIR/exercises
25
+
26
+if [ -z "${basenames}" ] ; then
27
+    # Locate the scripts we should run
28
+    basenames=$(for b in `ls $EXERCISE_DIR/*.sh`; do basename $b .sh; done)
29
+else
30
+    # If RUN_EXERCISES was specified, ignore SKIP_EXERCISES.
31
+    SKIP_EXERCISES=
32
+fi
23 33
 
24 34
 # Track the state of each script
25 35
 passes=""