Re: [PATCH v2 5/8] test_terminal: give priority to test-terminal.perl usage
- From
Jeff King <peff@peff.net>
- Date
- Oct 22, 2010, 19:42 UTC
- Message-ID
- <20101022194252.GC13059@sigill.intra.peff.net>
- In-Reply-To
- <1287254223-4496-6-git-send-email-rctay89@gmail.com>
On Sun, Oct 17, 2010 at 02:37:00AM +0800, Tay Ray Chuan wrote:
Show 18 quoted lines
> The outcome depends on whether stdout was already a terminal (in which > case test_terminal is a noop) or not (in which case test_terminal > introduces a pseudo-tty in the middle of the pipeline). > > $ test_terminal.perl sh -c 'test -t 1 && echo >&2 YES' >out > YES > $ sh -c 'test -t 1 && echo >&2 YES' >out > $ > > How about this? > > - use the test_terminal script even when running with "-v" > if IO::Pty is available, to allow commands like > > test_terminal foo >out 2>err > > - add a separate TTYREDIR prerequisite which is only set > when the test_terminal script is usable
Is it even worth keeping the direct-to-tty code at all? Yes, it means that people without IO::Pty can use _some_ terminal tests with "-v". But it creates a headache for test writers in understanding the subtle difference between TTY and TTYREDIR.
-Peff