Re: [PATCH] Windows: Fix intermittent failures of t7701

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

 



Hi,

On Tue, 27 Jan 2009, Jeff King wrote:

> On Tue, Jan 27, 2009 at 05:42:03PM +0100, Johannes Schindelin wrote:
> 
> > > We want to catch failures of test-chmtime; but since it appears in a 
> > > pipe, we cannot access its exit code. Therefore, we at least make sure 
> > > that it prints time stamps of all files that are passed on its command 
> > > line.
> > 
> > I use this trick in my valgrind series:
> > 
> > 	($PROGRAM; echo $? > exit.code) | $OTHER_PROGRAM &&
> > 	test 0 = "$(cat exit.code)"
> 
> Oh, that's far too readable. How about:
> 
>   exec 3>&1
>   status=$( ( ($PROGRAM ; echo $? >&4) | $OTHER_PROGRAM >&3) 4>&1 )
>   exec 3>&-
> 
> But seriously, I think if we are talking about tests, then
> 
>   $PROGRAM >output &&
>   $OTHER_PROGRAM <output
> 
> is very clear to read, and as a bonus makes "output" accessible for
> viewing when the test breaks.

The real problem is that in my case, OTHER_PROGRAM=tee.

But you're right, Hannes was talking about tests, where it might 
even make sense to have a record of what was passed between the 
two programs.

Ciao,
Dscho

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

  Powered by Linux