aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2019-06-26 23:42:14 -0500
committerRob Landley <rob@landley.net>2019-06-26 23:42:14 -0500
commitc77018116cff4dbb9636f94ca54dffe75c5eaccb (patch)
treea7dae00b68d4968729749d6533fff8be8c1b384f /scripts
parent40e55eb40afab3bc978fb42b6ec009a108d8e0c3 (diff)
downloadtoybox-c77018116cff4dbb9636f94ca54dffe75c5eaccb.tar.gz
testcmd shouldn't use shell builtin for TEST_HOST unless there isn't
one in $PATH.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/test.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/scripts/test.sh b/scripts/test.sh
index ea58f56f..d9955a5f 100755
--- a/scripts/test.sh
+++ b/scripts/test.sh
@@ -34,11 +34,13 @@ do_test()
cd "$TESTDIR" && rm -rf testdir && mkdir testdir && cd testdir || exit 1
CMDNAME="${1##*/}"
CMDNAME="${CMDNAME%.test}"
- C="$CMDNAME"
if [ -z "$TEST_HOST" ]
then
C="$TESTDIR/$CMDNAME"
[ ! -e "$C" ] && echo "$CMDNAME disabled" && return
+ else
+ C="$(which $CMDNAME 2>/dev/null)"
+ [ -z "$C" ] && "C=$CMDNAME"
fi
. "$1"