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 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 &&
> > 	"$@" >output &&
> > 	test_cmp expect output
> >   }
> 
> I agree with the principle in general.
> 
> Unfortunately that wouldn't help here --- the "$@" is a command with a
> pipe to sed in it and we still lose the exit status from
> count-objects.

Thanks, I missed that subtlety from what you posted earlier. That's
another good reason that something like test_output is not really
sufficient (you could eval() a snippet of shell, but then we have not
really improved on the "verbose test $a = $b" version, since as you note
we are still missing the exit code).

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