Re: [PATCH 2/3] t5304: use helper to report failure of "test foo = bar"

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

 



On Mon, Oct 13, 2014 at 2:31 PM, Jonathan Nieder <jrnieder@xxxxxxxxx> wrote:
> Jeff King wrote:
>> On Mon, Oct 13, 2014 at 09:10:22AM -0700, Jonathan Nieder wrote:
>
>>> There's another downside to that construct: it loses the exit
>>> status from some_cmd.
>>
>> Yes, although I think in many cases it's not a big deal. For example,
>> here we lose the exit code of count-objects, but it also is very
>> unlikely to fail _and_ produce our expected output.
>
> It could segfault after producing the good output, but sure,
> count-objects code doesn't change very often.

"Doesn't change very often" is not the issue. Here we are not testing
if it can count correctly without crashing, which *is* the real reason
why it is perfectly fine to use $(git count-objects | sed ...) pattern here.

There of course should be a test for count-objects to make sure it
counts correctly without crashing.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[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]