diff options
author | Rob Landley <rob@landley.net> | 2020-11-15 04:45:12 -0600 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2020-11-15 04:45:12 -0600 |
commit | a24b186ea84ca5c65b367a17dfade57e9c6fd704 (patch) | |
tree | 1c28a402cacb8c60e28f0e77ff7e25cac35522d8 /scripts | |
parent | 1377dd2221010b67fdf9127ce41fa2dbefe94b98 (diff) | |
download | toybox-a24b186ea84ca5c65b367a17dfade57e9c6fd704.tar.gz |
Change test default to VERBOSE=fail, add all/quiet for old =1 and default.
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/runtest.sh | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/scripts/runtest.sh b/scripts/runtest.sh index 89e632fc..ddbf0549 100644 --- a/scripts/runtest.sh +++ b/scripts/runtest.sh @@ -8,9 +8,9 @@ # The following environment variables enable optional behavior in "testing": # DEBUG - Show every command run by test script. -# VERBOSE - Print the diff -u of each failed test case. -# If equal to "fail", stop after first failed test. -# "nopass" to not show successful tests +# VERBOSE - "all" continue after failed test +# "quiet" like all but just print FAIL (no diff -u). +# "nopass" don't show successful tests # # The "testcmd" function takes five arguments: # $1) Description to display when running command @@ -69,7 +69,7 @@ optional() skipnot() { - if [ -z "$VERBOSE" ] + if [ "$VERBOSE" == quiet ] then eval "$@" 2>/dev/null else @@ -114,7 +114,7 @@ testing() if [ -n "$SKIP" -o -n "$SKIP_HOST" -a -n "$TEST_HOST" -o -n "$SKIPNEXT" ] then - [ ! -z "$VERBOSE" ] && printf "%s\n" "$SHOWSKIP: $NAME" + [ "$VERBOSE" != quiet ] && printf "%s\n" "$SHOWSKIP: $NAME" unset SKIPNEXT return 0 fi @@ -132,12 +132,12 @@ testing() then FAILCOUNT=$(($FAILCOUNT+1)) printf "%s\n" "$SHOWFAIL: $NAME" - if [ -n "$VERBOSE" ] + if [ "$VERBOSE" != quiet ] then [ ! -z "$4" ] && printf "%s\n" "echo -ne \"$4\" > input" printf "%s\n" "echo -ne '$5' |$EVAL $2" printf "%s\n" "$DIFF" - [ "$VERBOSE" == fail ] && exit 1 + [ "$VERBOSE" != all ] && exit 1 fi else [ "$VERBOSE" != "nopass" ] && printf "%s\n" "$SHOWPASS: $NAME" @@ -168,7 +168,7 @@ do_fail() echo "Expected '$CASE'" echo "Got '$A'" fi - [ "$VERBOSE" == fail ] && exit 1 + [ "$VERBOSE" != all ] && [ "$VERBOSE" != quiet ] && exit 1 } # txpect NAME COMMAND [I/O/E/Xstring]... @@ -251,7 +251,7 @@ txpect() then do_pass else - [ ! -z "$VERBOSE" ] && echo "$VERBOSITY" >&2 + [ "$VERBOSE" != quiet ] && echo "$VERBOSITY" >&2 fi } |