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

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

 



On Fri, Oct 03, 2014 at 03:17:18PM -0700, Junio C Hamano wrote:

> > That's a bit verbose. We could hide it behind something like test_eq,
> > too, but it introduces several extra new processes.
> 
> What do you mean by "extra new processes"?  Whether open coded in a
> verbose way, or wrapped inside a helper, e.g.
> 
> 	test_eql () {
> 		echo "$1" >expect &&
>                 shift &&
>                 "$@" >actual &&
>                 test_cmp expect actual
> 	}
>         ...
> 	test_eql whatever do_something
> 
> the number of processes would be the same, no?
> 
> Or do you mean test_cmp is an extra process compared with
> 
> 	test_eq whatever "$(do_something)"

Sorry, yeah, I meant new processes versus "test $foo = $bar".

> Hopefully, do_something does something more than what takes test_cmp
> to run, so I wouldn't be worried too much about it.

Yeah, I may just be overly paranoid here. If we are not worried about a
few extra processes, then the test_eql you showed above may be
preferable, because its output is uniform with other test_cmp tests
(although maybe it also introduces problems, because it does not handle
stray whitespace in the same way, and it puts extra files in the working
tree).

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