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

Re: [PATCH 2/3] t: teach 'test_must_fail' to save the command's stderr to a file

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 9, 2018, 18:36 UTC
Message-ID
<xmqqd11exb6k.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<20180209142131.GA18701@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 12 quoted lines
>   2. The "-x" problems aren't specific to test_must_fail at all. They're
>      a general issue with shell functions.
>
> I'm not entirely happy with saying "if you want to use -x, please use
> bash". But given that it actually solves the problems everywhere with no
> further effort, is it really that bad a solution?
>
> For the error messages from test_must_fail, could we go in the same
> direction, and send them to descriptor 4 rather than 2? We've already
> staked out descriptor 4 as something magical that must be left alone
> (see 9be795fb). If we can rely on that, then it becomes a convenient way
> for functions to make sure their output is going to the script's stderr.

That sounds clever and rather attractive. It isn't that much of an layering violation for test-lib-functions.sh::test_must_fail to have such an intimate knowledge on how test_-lib.sh::test_eval_ sets up the file descriptors, either.

Previous: Jeff KingNext: Jeff King
Message 6 of 13 in “Teach 'test_must_fail' to save the command's stderr to a file”
  1. 0/3 Teach 'test_must_fail' to save the command's stderr to a fileSZEDER Gábor, Feb 9, 2018
  2. 1/3 t: document 'test_must_fail ok=<signal-name>'SZEDER Gábor, Feb 9, 2018
  3. 2/3 t: teach 'test_must_fail' to save the command's stderr to a fileSZEDER Gábor, Feb 9, 2018
  4. Eric SunshineFeb 9, 2018
  5. Jeff KingFeb 9, 2018
  6. Junio C HamanoFeb 9, 2018
  7. Jeff KingFeb 9, 2018
  8. Jeff KingFeb 9, 2018
  9. SZEDER GáborFeb 23, 2018
  10. 3/3 t1404: use 'test_must_fail stderr=<file>'SZEDER Gábor, Feb 9, 2018
  11. Eric SunshineFeb 9, 2018
  12. SZEDER GáborFeb 9, 2018
  13. Junio C HamanoFeb 9, 2018

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.