aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2019-03-31 17:21:55 -0500
committerRob Landley <rob@landley.net>2019-03-31 17:21:55 -0500
commit22905c647338e6276ca6fd3e325afead2e7d081d (patch)
tree455ba6332d05ab9447dd094d53e1be6de3679658 /scripts
parent591f32cb97d24044930cc44597d79afd95741dc7 (diff)
downloadtoybox-22905c647338e6276ca6fd3e325afead2e7d081d.tar.gz
Add "skipnot" function to test suite, skips next test if command line fails.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/runtest.sh14
1 files changed, 13 insertions, 1 deletions
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