]> git.ipfire.org Git - thirdparty/util-linux.git/commit
tests: use env and support both unbuffer/stdbuf
authorPatrick Steinhardt <ps@pks.im>
Wed, 28 Aug 2019 06:56:24 +0000 (08:56 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 28 Aug 2019 06:56:24 +0000 (08:56 +0200)
commit59a46f36b604fe46747d5a5b6c85078a39b37c2e
tree05602809a2be4af6e7ea923ae8d270f909def907
parent71210f5babd0666494ac649374c47a0dd6db8546
tests: use env and support both unbuffer/stdbuf

Triggered by commit f612c4c67 (tests: fix --unbuffered mode with
ASAN, 2019-08-27), which says:

    Well, this patch sucks. It would be nice to have things in
    the way how it has been original expected by Patrick's patch,
    but ...

So this commit here effectively reverts it and instead tries to
improve the shortcomings of the original patch. First, it uses
env(1) to set ASAN_OPTIONS instead of directly adding it to the
args array to fix execution of "${args[@]}" "$@".

Second, it now supports both unbuffer(1) and stdbuf(1). The
latter uses LD_PRELOAD tricks, which doesn't play nicely with
ASAN, so it will not be used if ASAN has been requested. It's
still valuable to have support for both, as many more systems
will have stdbuf(1) from coreutils installed but not unbuffer(1)
from expect.

Signed-off-by: Karel Zak <kzak@redhat.com>
tests/functions.sh