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

Re: [PATCH 1/3] test-lib: tests can have multiple prerequisites

From
Jeff King <peff@peff.net>
Date
Apr 27, 2010, 01:25 UTC
Message-ID
<20100427012511.GA1844@coredump.intra.peff.net>
In-Reply-To
<7vpr1liwrk.fsf@alter.siamese.dyndns.org>
On Mon, Apr 26, 2010 at 05:06:55PM -0700, Junio C Hamano wrote:
Show 15 quoted lines
> Jeff King <peff@peff.net> writes:
> 
> > I do wonder if it might be less error-prone to have:
> >
> >   test_expect_success PREREQ1 PREREQ2 'desc' 'test'
> >
> > instead of
> >
> >   test_expect_success 'PREREQ1 PREREQ2' 'desc' 'test'
> 
> Spot what is wrong with this:
> 
>         test_expect_success make sure we have the repo '
>                 test -d .git
>         '

To me it's easy to spot, but there is nothing wrong with it that the shell will spot, so that is a downside. Whatever we go with, it would perhaps be less error prone to set "NOPREREQ1" when we don't have PREREQ1, and check that either $1 or NO$1 is set when checking prerequisites. But that is probably just over-engineering. This is not an error we have seen a lot of, and it is not that hard to spot with code review.

-Peff
Previous: Junio C HamanoNext: Jonathan Nieder
Message 6 of 8 in “running tests as fakeroot”
  1. 0/3 running tests as fakerootJonathan Nieder, Apr 21, 2010
  2. 1/3 test-lib: tests can have multiple prerequisitesJonathan Nieder, Apr 21, 2010
  3. Jonathan NiederApr 21, 2010
  4. Jeff KingApr 26, 2010
  5. Junio C HamanoApr 27, 2010
  6. Jeff KingApr 27, 2010
  7. 2/3 t1004 (read-tree): the unremovable symlink test requires POSIXPERMJonathan Nieder, Apr 21, 2010
  8. 3/3 Permit tests to be run as a (fake) root userJonathan Nieder, Apr 21, 2010

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.