...
 
Commits (2)
......@@ -42,4 +42,5 @@ password=$(read_password 6)
echo "Done: password=\"$password\""
# @Test
# @TestInteractive true
# vim: ai et sts=4 ts=4 sw=4
......@@ -31,4 +31,5 @@ echo "baz foo bar" | check_input
echo "zeb foo bar" | check_input
# @Test
# @TestRv 1
# vim: ai et sts=4 ts=4 sw=4
......@@ -86,4 +86,5 @@ ${FALLBACK:-false} || read -r input
reset_terminal
# @Test
# @TestInteractive true
# vim: ai et sts=4 ts=4 sw=4
......@@ -6,6 +6,13 @@ dir="$(dirname "$(readlink -f "$0")")/.."
RV=0
FAILED=""
if test "$1" = "--noninteractive" ; then
interactive=false
shift
else
interactive=true
fi
scripts="$1"
at_exit() {
......@@ -41,10 +48,8 @@ filter_tag() {
' < "$2"
if test $? = "0" ; then
echo "DEBUG: filter_tag($1, $2): success" >&2
return 0
else
echo "DEBUG: filter_tag($1, $2): not found" >&2
return 1
fi
}
......@@ -58,6 +63,10 @@ file2testrv() {
filter_tag "TestRv" "$1"
}
file2testinteractive() {
filter_tag "TestInteractive" "$1"
}
add_error() {
msg=$1
......@@ -100,8 +109,11 @@ for script in [0-9]*/[0-9]*sh ; do
params_rv=$?
testrv="$(file2testrv "$script" || echo 0)"
testinteractive="$(file2testinteractive "$script" || echo false)"
if test "$params_rv" = "0" ; then
if "$testinteractive" && ! $interactive ; then
echo "Info: Skipping interactive \"$script\"." >&2
elif test "$params_rv" = "0" ; then
eval "\"$script\" $testparams"
scriptrv="$?"
......