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

Re: [PATCH] test-lib: guard against being run as 'prove t*.sh'

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 11, 2021, 17:33 UTC
Message-ID
<xmqqwnudegse.fsf@gitster.g>
In-Reply-To
<20210311124216.25036-1-avarab@gmail.com>
Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:
Show 8 quoted lines
> We have t/Makefile targets to properly run the tests with prove,
> however it's also just as valid to run them as e.g.:
>
>     prove t[0-9]*.sh
>
> But if they're run as:
>
>     prove t*.sh

I am not sure if the above is a good enough excuse to diverge from our convention not to add #! to signal that a scriptlet is not to be used standalone but is meant to be dot-sourced. At least to me, this change looks like making the codebase worse to protect from a mistake that we should not have to worry about in real life.

But that may be because my use of prove is limited to a more targetted and narrow set of tests (i.e. either use "t4???-*.sh" for an area, or a single test---anything broader I'd use "make").

Previous: Ævar Arnfjörð Bjarmason
Message 2 of 2 in “test-lib: guard against being run as 'prove t*.sh'”
  1. test-lib: guard against being run as 'prove t*.sh'Ævar Arnfjörð Bjarmason, Mar 11, 2021
  2. Junio C HamanoMar 11, 2021

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.