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

From: Ramsay Jones <[email-masked]>
Date: Sat, 28 Jul 2012 19:03:17 +0100

Jonathan Nieder wrote:
> [...]
>> [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?

Heh, well they do indeed act just like they do in text_expect_success blocks!

I spent only about 20 minutes writing test_fixture, playing with it, and then
deciding to shelve it for now. Again, I wanted a *quick* fix for the TAP
parse error, so that it would make it into v1.7.12. :(

Having now spent a further 30 minutes, I can see that I did a better job than
I thought! :-P

Actually, scratch that; rather I should say that Junio and the other authors
of the test infrastructure did such a good job (particularly with separation
of concerns), that I lucked into a good implementation.

I still haven't done any serious testing, so if I subsequently find any
problems, then the lousy implementation is my fault! ;-)

> FWIW I find Junio's test_setup name more self-explanatory.  What
> mnemonic should I be using to remember the _fixture name?

I don't have a problem with 'test_setup' either; test-fixture comes from the
various xUnit unit-test libraries. (I think Kent Beck et.al. wrote JUnit first
and then it was ported to various other languages. eg cppUnit for C++).

Briefly, a test-fixture provides a context or common environment, via code for
test setup and teardown, in which to run one or more tests.

HTH

ATB,
Ramsay Jones