Well, with this release CppUnit began its travel toward portability.
Support for custom exception base class (such as CException for example) has
finally been added . API to write custom test case macro has also been
simplified.
The tar balls can be found at: http://cppunit.sourceforge.net/snapshot/
http://cppunit.sourceforge.net/snapshot/cppunit-1.9.10.tar.gz
http://cppunit.sourceforge.net/snapshot/cppunit-docs-1.9.10.tar.gz
Enjoy,
Baptiste.
New in CppUnit 1.9.10:
---------------------
- Major portability improvement
- Protector
- HelperMacros
- MFC TestRunner bug fixes
- Failure diagnostic
- Asserter
* Major portability improvement:
- Much work has been done to reduce C++ feature requirement to compile
CppUnit. It should now be possible to compile CppUnit on most
compilers, as long as STL are available (in std namespace or not),
with some form of strstream and iostream, as well as exception support.
See CodingGuideLines.txt for details.
* Protector
- Protector can be passed to the TestResult to 'protect' call to
setUp(), runTest() and tearDown() method. With this, it is easy to
capture exceptions which do not have std::exception as a base class,
such as CException or RWXMsg for example. TestResult and Protector
class documentation. Look at src/cppunit/DefaultProtector.cpp for
an example of implementation.
* Helper macros
- Mostly rewritten. It no longer use TestSuiteBuilder. A new object
TestSuiteBuilderContext was introduced. It is used to name test case,
create test fixture instance and add test to the fixture suite. It
is now much more easier to add custom test cases using
CPPUNIT_TEST_SUITE_ADD_CUSTOM_TESTS. Should also prevent most
compability break concerning that macro.
- Useful typedef are now public: TestFixtureType, ParentTestFixtureType.
- New typedef for custom test method parameter:
typedef TestSuiteBuilderContext<TestFixtureType>
TestSuiteBuilderContextType;
- added support for abstract test fixture with
CPPUNIT_TEST_SUITE_END_ABSTRACT(). See documentation for further
detail.
* Failure diagnostic
- setUp() and tearDown() now provides a detailed diagnostic of the
failure (assertion, exception...)
- If RTTI is allowed to extract type info, CppUnit will report the
actual exception type in the diagnostic.
* Asserter:
- A new AdditionalMessage class has been introduced. It is used for
assertion that takes an additional 'message' argument
(CPPUNIT_ASSERT_MESSAGE...). Since this macro has an implicit
constructor that take a string, which creates a Message with the
specified string as detail. That way, additional message can be a
single string or a complex Message object. See documentation for
example of use.
* Bug Fix:
- MFC TestRunner: bug #530426 (conflict between TestRunner and host
application's resources). A huge thanks to Steven Mitter for that one.
- MFC TestRunner: Browse button is now disabled while running test.
* Deprecated
- CppUnit::TextUi::TestRunner moved to CppUnit::TextTestRunner.
- CppUnit::MfcUi::TestRunner moved to CppUnit::MfcTestRunner.
- CppUnit::QtUi::TestRunner moved to CppUnit::QtTestRunner.
* Compatiblity break:
- CppUnitTextUi::TestRunner, removed runTestByName() and runTest().
- TestSuiteBuilder: removed templatized method
addTestCallerForException(). See implementation of
CPPUNIT_TEST_EXCEPTION implementation for an alternative.
- TestAssert: removed deprecated functions (those not using SourceLine)
assertImplementation(), assertNotEqualImplementation(),
assertEquals(). Moved non deprecated functions assertEquals() and
assertEquals() into CppUnit namespace.
- Plug-ins 'Parameters' typedef has been replaced by class
PlugInParameters. The method commandLine() returns what used to be in
Parameters[0]. This should avoid future compatibility break when the
parameters passing API will be defined.
- TestPlugIn::initialize() now takes a PlugInParameters in argument
instead of a Parameters.
- template <class T> void assertEquals() no longer has a default message
value (no impact, unless you used this function directly instead of
assertion macros).
- HelperMacros: renamed CPPUNIT_TEST_ADD to
CPPUNIT_TEST_SUITE_ADD_TEST.
- HelperMacros: removed CPPUNIT_TEST_CUSTOM. Instead use
CPPUNIT_TEST_SUITE_ADD_CUSTOM_TESTS and call context.addTest()
passing the test that was returned.
- HelperMacros: renamed CPPUNIT_TEST_CUSTOMS to
CPPUNIT_TEST_SUITE_ADD_CUSTOM_TESTS. Changed method signature to
static void aMethodName( TestSuiteBuilderContextType &context ).
You can replace the 3 previous parameters by context. (See
documentation for further detail).
---
Baptiste Lepilleur <gai...@fr...>
http://gaiacrtn.free.fr/
|