Re: [PATCH v5 26/26] t7700: stop losing return codes of git commands

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Nov 30, 2019 at 5:48 AM Danh Doan <congdanhqx@xxxxxxxxx> wrote:
> On 2019-11-27 11:54:04-0800, Denton Liu <liu.denton@xxxxxxxxx> wrote:
> > +   ! grep "^$coid " packlist &&
>
> I think we want to use test_must_fail instead of !

test_must_fail() is intended only for use with 'git' commands; "!"
should be used otherwise. Quoting from t/README:

    Don't use '! git cmd' when you want to make sure the git command
    exits with failure in a controlled way by calling "die()".  Instead,
    use 'test_must_fail git cmd'.  This will signal a failure if git
    dies in an unexpected way (e.g. segfault).

    On the other hand, don't use test_must_fail for running regular
    platform commands; just use '! cmd'.  We are not in the business
    of verifying that the world given to us sanely works.

So, Denton's use of "!" here is correct.



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux