I am just starting my integration with CppUnit and would like to use the Helper Macros. I have been able to create a Suite and Test Fixtures without the Macros just fine, but when I add the #include <cppunit/extensions/HelperMacros.h> into my file without even calling any of the Macros, I receive compiler errors. I am using the CppUnit version 1.12 and I am compiling with MinGW. The following are my errors:
In file included from ../../lib/cppunit/include/cppunit/extensions/HelperMacros.
h:12,
from vmfmessagelogUT.cpp:15:
../../lib/cppunit/include/cppunit/extensions/ExceptionTestCaseDecorator.h: In me
mber function `void CppUnit::ExceptionTestCaseDecorator<ExpectedException>::runT
est()':
../../lib/cppunit/include/cppunit/extensions/ExceptionTestCaseDecorator.h:73: er
ror: `e' undeclared (first use this function)
../../lib/cppunit/include/cppunit/extensions/ExceptionTestCaseDecorator.h:73: er
ror: (Each undeclared identifier is reported only once for each function it appe
ars in.)
../../lib/cppunit/include/cppunit/extensions/ExceptionTestCaseDecorator.h:84: er
ror: cannot use typeid with -fno-rtti
../../lib/cppunit/include/cppunit/extensions/ExceptionTestCaseDecorator.h:84: er
ror: no matching function for call to `CppUnit::TypeInfoHelper::getClassName(<ty
pe error>)'
../../lib/cppunit/include/cppunit/extensions/TypeInfoHelper.h:25: note: candidat
es are: static std::string CppUnit::TypeInfoHelper::getClassName(const std::type
_info&)
mingw32-make: *** [tmp\obj\vmfmessagelogUT.o] Error 1
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
After my posting, I discovered the answer to my problem. It was really a QT setup issue. QT was creating my makefile for my unit test with the "no-rtti" and "no-exceptions" commands. This can be enabled by setting "CONFIG+= rtti exceptions" in the qmake options. Hope that may help someone else.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am just starting my integration with CppUnit and would like to use the Helper Macros. I have been able to create a Suite and Test Fixtures without the Macros just fine, but when I add the #include <cppunit/extensions/HelperMacros.h> into my file without even calling any of the Macros, I receive compiler errors. I am using the CppUnit version 1.12 and I am compiling with MinGW. The following are my errors:
In file included from ../../lib/cppunit/include/cppunit/extensions/HelperMacros.
h:12,
from vmfmessagelogUT.cpp:15:
../../lib/cppunit/include/cppunit/extensions/ExceptionTestCaseDecorator.h: In me
mber function `void CppUnit::ExceptionTestCaseDecorator<ExpectedException>::runT
est()':
../../lib/cppunit/include/cppunit/extensions/ExceptionTestCaseDecorator.h:73: er
ror: `e' undeclared (first use this function)
../../lib/cppunit/include/cppunit/extensions/ExceptionTestCaseDecorator.h:73: er
ror: (Each undeclared identifier is reported only once for each function it appe
ars in.)
../../lib/cppunit/include/cppunit/extensions/ExceptionTestCaseDecorator.h:84: er
ror: cannot use typeid with -fno-rtti
../../lib/cppunit/include/cppunit/extensions/ExceptionTestCaseDecorator.h:84: er
ror: no matching function for call to `CppUnit::TypeInfoHelper::getClassName(<ty
pe error>)'
../../lib/cppunit/include/cppunit/extensions/TypeInfoHelper.h:25: note: candidat
es are: static std::string CppUnit::TypeInfoHelper::getClassName(const std::type
_info&)
mingw32-make: *** [tmp\obj\vmfmessagelogUT.o] Error 1
After my posting, I discovered the answer to my problem. It was really a QT setup issue. QT was creating my makefile for my unit test with the "no-rtti" and "no-exceptions" commands. This can be enabled by setting "CONFIG+= rtti exceptions" in the qmake options. Hope that may help someone else.