Re: [PATCH 2/3] tests: test terminal output to both stdout and stderr
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Oct 14, 2010, 03:27 UTC
- Message-ID
- <20101014032734.GC14664@burratino>
- In-Reply-To
- <20101014030443.GB5626@sigill.intra.peff.net>
Jeff King wrote:
Show 7 quoted lines
> Some outputs (like the pager) care whether stdout is a > terminal. Others (like progress meters) care about stderr. > > This patch sets up both. Technically speaking, we could go > further and set up just one (because either the other goes > to a terminal, or because our tests are only interested in > one).
This makes test_terminal more realistic, too: the usual case is for stdout and stderr to go to a terminal (unless explicitly captured or redirected).
Tests can use 'test_terminal sh -c "foo >/dev/null"' to test that a command correctly handles being run with stderr a terminal and stdout not.
And I doubt this would make test_terminal much slower.
So for what it's worth: Acked-by: Jonathan Nieder <jrnieder@gmail.com>
Thanks.