done
unset v
+xecho () { printf '%s\n' "$*"; }
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=PATH] [SHELL-OPTIONS] TEST [TEST-OPTIONS]"
+ xecho "Usage: $0 [--shell=PATH] [-k] [SHELL-OPTIONS]" \
+ "[VAR=VALUE ...] TEST [TEST-OPTIONS]"
exit $?
;;
--shell)
shell_opts="$shell_opts -o $2"
shift
;;
+ -k|--keep-testdir|--keep-testdirs)
+ keep_testdirs=yes; export keep_testdirs;;
-*)
# Assume it is an option to pass through to the shell.
shell_opts="$shell_opts $1";;
+ *=*)
+ var=${1%%=*} val=${1#*=}
+ xecho "$var" | LC_ALL=C grep '^[a-zA-Z_][a-zA-Z0-9_]*$' >/dev/null \
+ || error "'$var': invalid variable name"
+ eval "$var=\$val && export $var" || exit 1
+ ;;
*)
break;;
esac