#32 Premature fixture setup calls

-- deleted --
closed
nobody
5
2002-03-22
2002-01-11
Anonymous
No

When running tests on a Windows platform, the CppUnit
test runner instantiates all of the test fixtures
simultaneously, before the selection of which tests
are to be run. At a minimum, I would expect that only
the tests selected for a test run would have their
fixtures instantiated. I would consider it good
behavior to have each test's fixture set up
immediately before it is run, and destroyed
immediately afterwards. While this is not a problem
for many tests, I have been testing internally
threaded classes, and the current behavior is a
problem for obvious reasons.

Discussion

  • Baptiste Lepilleur

    Logged In: YES
    user_id=196852

    Fixture (class using CPPUNIT_TEST macros) are only
    instantiated when
    TestFactoryRegistry::makeTest() is called (or the suite()
    static method of the fixture is called).

    setUp() is called only once just before each test is
    called. tearDown() is called only if setUp()was successful.
    Look at TestCase::run() for detail.

     
  • Baptiste Lepilleur

    • status: open --> closed
     

Log in to post a comment.