From 22905c647338e6276ca6fd3e325afead2e7d081d Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sun, 31 Mar 2019 17:21:55 -0500 Subject: Add "skipnot" function to test suite, skips next test if command line fails. --- scripts/runtest.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/runtest.sh b/scripts/runtest.sh index d08657cb..ab10bf44 100644 --- a/scripts/runtest.sh +++ b/scripts/runtest.sh @@ -66,6 +66,17 @@ optional() SKIP=1 } +skipnot() +{ + if [ -z "$VERBOSE" ] + then + eval "$@" 2>/dev/null + else + eval "$@" + fi + [ $? -eq 0 ] || SKIPNOT=1 +} + wrong_args() { if [ $# -ne 5 ] @@ -86,9 +97,10 @@ testing() [ -n "$DEBUG" ] && set -x - if [ -n "$SKIP" ] || ( [ -n "$SKIP_HOST" ] && [ -n "$TEST_HOST" ]) + if [ -n "$SKIP" -o -n "$SKIP_HOST" -a -n "$TEST_HOST" -o -n "$SKIPNOT" ] then [ ! -z "$VERBOSE" ] && echo "$SHOWSKIP: $NAME" + unset SKIPNOT return 0 fi -- cgit v1.2.3