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?
Nick
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
Good luck,
Bastiaan
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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).
Baptiste.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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?
Nick
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.
Good luck,
Bastiaan
Thanks Bastiaan.
What functionality, if any, do you lose by disabling RTTI?
Nick
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).
Baptiste.
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?