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

2014-10-13 Thread Jonathan Nieder
Jeff King wrote: For small outputs, we sometimes use: test $(some_cmd) = something we expect instead of a full test_cmp. The downside of this is that when it fails, there is no output at all from the script. There's another downside to that construct: it loses the exit status from

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

2014-10-13 Thread Jeff King
On Mon, Oct 13, 2014 at 09:10:22AM -0700, Jonathan Nieder wrote: Jeff King wrote: For small outputs, we sometimes use: test $(some_cmd) = something we expect instead of a full test_cmp. The downside of this is that when it fails, there is no output at all from the script.

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

2014-10-13 Thread Jonathan Nieder
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

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

2014-10-13 Thread Junio C Hamano
On Mon, Oct 13, 2014 at 2:31 PM, Jonathan Nieder jrnie...@gmail.com 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

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

2014-10-13 Thread Jeff King
On Mon, Oct 13, 2014 at 02:31:32PM -0700, Jonathan Nieder wrote: One of my goals was to provide a more generic helper so that we don't have to make little helpers like this for every command. So I'd much rather something like: test_output () { printf %s\n $1 expect shift

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

2014-10-13 Thread Jonathan Nieder
Junio C Hamano wrote: On Mon, Oct 13, 2014 at 2:31 PM, Jonathan Nieder jrnie...@gmail.com wrote: 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

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

2014-10-13 Thread Junio C Hamano
Jonathan Nieder jrnie...@gmail.com writes: Junio C Hamano wrote: On Mon, Oct 13, 2014 at 2:31 PM, Jonathan Nieder jrnie...@gmail.com wrote: 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.

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

2014-10-10 Thread Jeff King
For small outputs, we sometimes use: test $(some_cmd) = something we expect instead of a full test_cmp. The downside of this is that when it fails, there is no output at all from the script. Let's introduce a small helper to make tests easier to debug. Signed-off-by: Jeff King p...@peff.net