runtest: support option --shell, tell which shell should run the test
authorStefano Lattarini <stefano.lattarini@gmail.com>
Wed, 25 Jul 2012 11:03:17 +0000 (13:03 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Wed, 25 Jul 2012 11:03:17 +0000 (13:03 +0200)
* runtest.in: Here.  The same effect could have been obtained by
exporting AM_TEST_RUNNER_SHELL to the desired value, but the new
API is simpler and requires less typing and less thinking.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
runtest.in

index 3c6981c..4bdcb49 100644 (file)
@@ -32,11 +32,19 @@ shell_opts=
 while test $# -gt 0; do
   case $1 in
     --help)
-       echo "Usage: $0 [SHELL-OPTIONS] TEST [TEST-OPTIONS]"
+       echo "Usage: $0 [--shell=PATH] [SHELL-OPTIONS] TEST [TEST-OPTIONS]"
        exit $?
        ;;
+    --shell)
+       test $# -gt 1 || error "missing argument for option '$1'"
+       AM_TEST_RUNNER_SHELL=$2
+       shift
+       ;;
+    --shell=*)
+       AM_TEST_RUNNER_SHELL=${1#--shell=}
+       ;;
     -o)
-       test $# -gt 1 || error "missing argument for option '-o'"
+       test $# -gt 1 || error "missing argument for option '$1'"
        shell_opts="-o $2"
        shift
        ;;