[Toybox] test.sh: Don't override "C" command path in TEST_HOST if it's set

Rob Landley rob at landley.net
Sun Mar 24 16:40:27 PDT 2024


On 3/22/24 16:10, Oliver Webb wrote:
>> On 3/21/24 21:38, Oliver Webb via Toybox wrote:
>> 
>> > 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
>> 
>> I've been doing "PATH=/path/to/thingy:$PATH TEST_HOST=1 make test_cmd" for
>> years, I didn't know that needed to be documented...
> 
> plan9 has a incompatible diff implementation, which means to test plan9 utils I'd
> either need to separate diff from the rest of the binaries or have some way of overriding "C".
> 
> Also, different command names, there's a dozen different vi implementations and 
> only a few have the name "vi". This is true for some other commands as well

I've been doing:

  mkdir sub
  ln -s $(which potato) sub/vi
  PATH=$PWD/sub:$PATH make tests

Comes up a bit already, such as testing toybox tar --xform which requires toybox
sed, and thus even the standalone test skips those unless you put toybox sed in
the $PATH.

In theory you could PATH=$PWD/sub:$PATH TEST_HOST=1 make test_vi above, in which
case "C" should wind up pointing into sub...

Rob


More information about the Toybox mailing list