[Toybox] [PATCH] test.tar: fix tar tests on Android.

Rob Landley rob at landley.net
Wed Jul 10 01:32:26 PDT 2019


On 7/10/19 1:47 AM, Rob Landley wrote:
> (Today I didn't write much C, instead I tried to put my cut-and-paste tests file
> into tests/sh.test so I could run TEST_HOST=1 and confirm I've got them all down
> right, and I went "this looks crazy, I just need sh -c "$TEST" for each one,
> rewrote it to be simpler, proved that doesn't work (because eval sh -c "test
> with quotes in it"), realized I already solved this last year and THAT'S why the
> test code isn't using a _simple_ wrapper for the normal testing function but
> instead doing that EVAL= thing... wasted 4 hours re-learning what I already knew
> because I tried to throw out code I'd forgotten the reason for. I'm not even
> that good at working with _myself_ when the gap's long enough...)

Regressoin testing here is extra hard because in theory:

  "echo -e 'if\ntrue\nthen\necho hello\nfi' | $SH -i"

produces output something like:

  '$ if\n> true\n> then\n> echo hello\n> fi\nhello\n'

But in PRACTICE bash writes it _not_ to stdout but to /dev/tty, and I have yet
to figure out how to stop it from doing this.

(Or I can write a pty wrapper, which has been on my todo list for a while, but
is not a rathole I want to go down right _now_...)

Rob



More information about the Toybox mailing list