Is it possible to use CppUnit 1.6.x under MSVC6 without having C++ RTTI enabled?
If not, would it be worth adding our own RTTI since not all platforms/compilers support RTTI, and having RTTI enabled can lead to some signficant performance probs?
Have a look at include/cppunit/config-msvc6.h: it contains a flag CPPUNIT_HAVE_RTTI. If you #undef it, CppUnit will not use RTTI dependent features. Use the appriopate compiler flag to disable RTTI in MSVC++ itself.
What functionality, if any, do you lose by disabling RTTI?
TestCase name extraction: the type passed to the CPPUNIT_TESTSUITE macro is used. Not much a bother unless you are using templatized test case.
More important, is the loss of the use of the MFC Test Runner which rely on dynamic_cast to distinguish between TestSuite and TestCase (a design in CppUnit if you ask me).
Would it not be worth adding a class name field to each class, and effeectively emulating our own RTTI? We would have to switch() on the class name, but I think this is a small price to pay for something that would be reliably cross platform and portable?
Log in to post a comment.