Re: [PATCH] Windows: Fix intermittent failures of t7701
- From
Jeff King <peff@peff.net>
- Date
- Jan 28, 2009, 04:28 UTC
- Message-ID
- <20090128042814.GA18216@coredump.intra.peff.net>
- In-Reply-To
- <alpine.DEB.1.00.0901271740320.3586@pacific.mpi-cbg.de>
On Tue, Jan 27, 2009 at 05:42:03PM +0100, Johannes Schindelin wrote:
Show 9 quoted lines
> > 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 downside is that it isn't very efficient for a large output, but most of our test output is small (and we don't care that much about efficiency).
Just my shell bikeshedding 2 cents. Feel free to ignore.
-Peff