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

Re: [RFC/PATCH] t3300-*.sh: Fix a TAP parse error

From
Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Date
Aug 19, 2012, 17:57 UTC
Message-ID
<50312911.30904@ramsay1.demon.co.uk>
In-Reply-To
<7vk3wyxv6e.fsf@alter.siamese.dyndns.org>
Junio C Hamano wrote:
Show 34 quoted lines
> Jonathan Nieder <jrnieder@gmail.com> writes:
>> Ramsay Jones wrote:
>>> Junio C Hamano wrote:
>>
>>>> Observing that all well-written test scripts we have begin with this
>>>> boilerplate line:
>>>>
>>>> 	test_expect_success setup '
>>>>
>>>> I wouldn't mind introducing a new helper function test_setup that
>>>> behaves like test_expect_success but is meant to be used in the
>>>> first "set-up" phase of the tests in a test script.
>>
>> Neat.  This could be used for later set-up tests, too, perhaps with a
>> long-term goal of making non set-up tests independent of each other
>> (reorderable and skippable).
>>
>> [...]
>>> [1] For example, what should/will happen if someone uses test_must_fail,
>>> test_might_fail, etc., within the test_fixture script? Should they simply
>>> be banned within a text_fixture?
>>
>> Why wouldn't they act just like they do in test_expect_success blocks?
>>
>> FWIW I find Junio's test_setup name more self-explanatory.  What
>> mnemonic should I be using to remember the _fixture name?
> 
> I see that I was distracted by the "where does the fixture come
> from" and did not follow through.
> 
> I think what it does makes sense (I haven't checked all the
> redirections, though).  Do we want to resurrect the topic?  It needs
> a paragraph in the proposed commit log and t/README to explain the
> motivation and the usage.
Yes, this is on my TODO list.
I will name the function 'test_setup' rather than 'test_fixture'.

Also, the test_fixture function had a single script parameter, since I didn't see the point of having a "title" like test_expect_success. However, I'm now in two minds about this; if it were to take a title it may be useful to include the title in the error message, if the test contained multiple calls to test_setup. I'm still inclined to *not* include a title parameter ...

ATB, Ramsay Jones

Previous: Junio C Hamano
Message 13 of 13 in “t3300-*.sh: Fix a TAP parse error”
  1. t3300-*.sh: Fix a TAP parse errorRamsay Jones, Jul 21, 2012
  2. Jonathan NiederJul 21, 2012
  3. Ramsay JonesJul 24, 2012
  4. Jonathan NiederJul 24, 2012
  5. Ramsay JonesJul 25, 2012
  6. Junio C HamanoJul 24, 2012
  7. Ramsay JonesJul 25, 2012
  8. Jonathan NiederJul 25, 2012
  9. Junio C HamanoJul 25, 2012
  10. Ramsay JonesJul 28, 2012
  11. Ramsay JonesJul 28, 2012
  12. Junio C HamanoAug 16, 2012
  13. Ramsay JonesAug 19, 2012

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.