[libvirt] [PATCH] tests: test-lib.sh portability and clean-up

Eric Blake eblake at redhat.com
Wed Mar 24 20:55:00 UTC 2010

On 03/24/2010 02:40 AM, Jim Meyering wrote:
> No big deal, but I saw recent additions of "test ... -a ..."
> (not portable) so fixed the rest, too.
> Now, searching for violations shows none:
>   git grep '\<test .* -a '

Better would be git grep '\<test .* -[ao] '

> Whether it's possible to rely on test -a in test scripts is debatable:
> perhaps you've ensured that the SHELL you use when running tests is
> POSIX compliant or better (I do that in coreutils),

But test -a is optional - POSIX says it is only required by XSI
extensions, and some shells (think posh) go so far as to explicitly
reject all optional POSIX constructs.  (Not that I know anyone crazy
enough to choose posh instead of dash as their /bin/sh, but still...)

> Since this is a global change, it deserves a syntax-check rule.

All right - that means it should be easy to submit a followup series to
kill test -o.

Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 323 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20100324/e674efc7/attachment-0001.sig>

More information about the libvir-list mailing list