automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[FYI] {maint} runtest: support passing options over to the shell


From: Stefano Lattarini
Subject: [FYI] {maint} runtest: support passing options over to the shell
Date: Wed, 25 Jul 2012 12:57:34 +0200

* runtest.in: Here.  Also, support '--help' to display a nice
help screen, with the help of ...
(print_help): ... this new function.

Signed-off-by: Stefano Lattarini <address@hidden>
---
 runtest.in | 28 +++++++++++++++++++++-------
 1 file changed, 21 insertions(+), 7 deletions(-)

diff --git a/runtest.in b/runtest.in
index 31f8e01..3c6981c 100644
--- a/runtest.in
+++ b/runtest.in
@@ -28,12 +28,26 @@ set -e; set -u
 error () { echo "$0: $*" >&2; exit 255; }
 
 # Some shell flags should be passed over to the test scripts.
-#while test $# -gt 0; do
-#  case $1 in
-#    --help) echo "Usage: $0 [SHELL-OPTIONS] TEST [TEST-OPTIONS]"; exit $?;;
-#    -*)
-#  esac
-#done
+shell_opts=
+while test $# -gt 0; do
+  case $1 in
+    --help)
+       echo "Usage: $0 [SHELL-OPTIONS] TEST [TEST-OPTIONS]"
+       exit $?
+       ;;
+    -o)
+       test $# -gt 1 || error "missing argument for option '-o'"
+       shell_opts="-o $2"
+       shift
+       ;;
+    -*)
+       # Assume it is an option to pass through to the shell.
+       shell_opts=$1;;
+     *)
+       break;;
+  esac
+  shift
+done
 
 test $# -gt 0 || error "missing argument"
 
@@ -58,5 +72,5 @@ case $tst in
       ;;
 esac
 
-wrapper "$AM_TEST_RUNNER_SHELL" "$tst" "$@"
+wrapper "$AM_TEST_RUNNER_SHELL" $shell_opts "$tst" "$@"
 error "dead code reached"
-- 
1.7.12.rc0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]