Support specifications of specific unit tests on the commandline
authorUlrich Dangel <uli@spamt.net>
Sun, 28 Mar 2010 14:30:14 +0000 (16:30 +0200)
committerUlrich Dangel <uli@spamt.net>
Sun, 28 Mar 2010 14:30:14 +0000 (16:30 +0200)
run_tests.sh

index 942adac..1d0728b 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/zsh
-if [ $# -ne 2 ] ; then
-    echo Usage: $0 cdrom mountpoint
+if [ $# -le 2 ] ; then
+    echo "Usage: $0 cdrom mountpoint [tests]"
     exit 1
 fi
 
@@ -9,10 +9,18 @@ export KERNEL=$(find "$2"/boot/ -name linux26)
 export INITRD=$(find "$2"/boot/ -name initrd.gz)
 export CMDLINE_COMMON="$(awk '/append/ {  $1 = $2 = ""; print }' "$2/boot/isolinux/default.cfg")"
 
+shift
+shift
 
 export SERVER_STATUS="$PWD/webserver.py"
 export FRAMEWORK="$PWD/framework.sh"
-for dir in *(/) ; do
+if [ -n "$1" ] ; then
+    TESTS=$*
+else
+    TESTS=(*(/))
+fi
+for dir in $TESTS ; do
+    [ ! -x $dir ] && continue
     cd $dir
     ./runit.sh >/dev/null
     cd -