A mildly annoying issue of you are trying to test with different 
implementations of commands
such as plan9 ones or sbase or busybox ones, things with different conflicting 
implementations 
of things like xxd or vi. With this patch you can do "make test_cmd TEST_HOST=1 
C=/path/to/other/cmd"
and have it work

-   Oliver Webb <aquahobby...@proton.me>
From 1bfb17686fb9fc2d09aed471765462ed1e34c2f4 Mon Sep 17 00:00:00 2001
From: Oliver Webb <aquahobby...@proton.me>
Date: Thu, 21 Mar 2024 21:27:19 -0500
Subject: [PATCH] test.sh: Add ability to change TEST_HOST command path (make
 test_foo TEST_HOST=1 C=/path/to/cmd)

---
 scripts/test.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/test.sh b/scripts/test.sh
index 03863c15..9bad3005 100755
--- a/scripts/test.sh
+++ b/scripts/test.sh
@@ -48,7 +48,7 @@ do_test()
     [ ! -e "$C" ] && echo "$SHOWSKIP: $CMDNAME disabled" && return
     C="$(dirname $(realpath "$C"))/$CMDNAME"
   else
-    C="$(which $CMDNAME 2>/dev/null)"
+    : "${C:=$(which $CMDNAME 2>/dev/null)}"
     [ -z "$C" ] && printf '%s\n' "$SHOWSKIP: no $CMDNAME" && return
   fi
 
-- 
2.44.0

_______________________________________________
Toybox mailing list
Toybox@lists.landley.net
http://lists.landley.net/listinfo.cgi/toybox-landley.net

Reply via email to