See https://bugzilla.mozilla.org/show_bug.cgi?id=641991
The reason for this is that we want "what is a test" to be atomic --
that is, there is something called a test that is the lowest level
"thing" that makes sense to run. You can't run part of a test -- that
makes no sense. A test may have arbitrary states and transitions
within it, but these are part of a test (which is to say, they are not
strictly unit test). In this case, having setupTest and teardownTest
is a bit silly and setupModule and teardownModule make more sense.
Restate our assumptions:
- a test file/module == a test
- this module will have (at least one) test* function and optionally
setupModule and teardownModule
- usually you'll want a single test function; you can probably get rid of
testSetup and testTeardown
- but running a single test function doesn't, in general, make much sense, as
there make be state accumulated via previous tests
- so the normal case is "a test == a single file with one test* function and
potentially a setupModule + teardownModule function
So if you're not using the assumption that 1 test == 1 file...you
should! Or if you have any concerns, please reply to this list or
reply to bug and we can discuss issues there.
Jeff
> Currently, thought its not widely used at least in QA's mozmill tests,
> we have functions setupTest and teardownTest. We plan on deprecating
> these for mozmill 2.0, slated for release soon (before April, we
> hope).
At least in our case we want to get rid of those test files and spread
out the tests into different modules. So it sounds fine with me.
--
Henrik Skupin
QA Execution Engineer
Mozilla Corporation