git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/3] test-terminal: give the child an empty stdin TTY

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 12, 2011, 20:06 UTC
Message-ID
<7vfwgp3683.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20111212190553.GJ31793@elie.hsd1.il.comcast.net>
Jonathan Nieder <jrnieder@gmail.com> writes:
Show 6 quoted lines
> Sorry, I was thinking narrowly about the "git log" tests in
> t7006-pager.sh.  I was saying that there, the fact that
> lib-terminal.sh creates an environment in which stdin is not
> guaranteed to be a terminal is a feature, not a bug, since it improves
> the test coverage (and I tend to find the "stdin not a tty" case more
> interesting).

I agree with Thomas's objective of giving ttys to all the streams of process being tested by default to emulate the usage better, but I also think being able to test some of the streams redirected to non-tty a good feature to have in test-terminal driver. And I do not think these two have to be either-or proposition.

I do not think "Run 'git log' as if the user is on an interactive terminal, but has plugged /dev/null to its standard input" can be spelled like this:

    test-terminal git log </dev/null

but test-terminal could learn an equivalent feature perhaps from the command line, no? Perhaps like

    test-terminal --stdin=/dev/null git log
    test-terminal --stdout=actual --stderr=error git shortlog
or somesuch?
Previous: Jonathan NiederNext: Junio C Hamano
Message 11 of 16 in “test-terminal: give the child an empty stdin TTY”
  1. 1/3 test-terminal: give the child an empty stdin TTYThomas Rast, Dec 12, 2011
  2. 2/3 test-terminal: set output terminals to raw modeThomas Rast, Dec 12, 2011
  3. Jonathan NiederDec 12, 2011
  4. Thomas RastDec 12, 2011
  5. Jonathan NiederDec 13, 2011
  6. 3/3 t/lib-terminal: test test-terminal's sanityThomas Rast, Dec 12, 2011
  7. Jonathan NiederDec 12, 2011
  8. Jonathan NiederDec 12, 2011
  9. Thomas RastDec 12, 2011
  10. Jonathan NiederDec 12, 2011
  11. Junio C HamanoDec 12, 2011
  12. Junio C HamanoDec 12, 2011
  13. Thomas RastDec 12, 2011
  14. Jeff KingDec 12, 2011
  15. Junio C HamanoDec 12, 2011
  16. Jonathan NiederDec 12, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.