[Cppunit-devel] [ANNOUNCE] CppUnit 1.8.0 release
Brought to you by:
blep
From: Baptiste L. <gai...@fr...> - 2002-04-11 11:21:51
|
I finally managed to make CppUnit 1.8.0 release. Available on: https://sourceforge.net/projects/cppunit/ Thanks for your help, Baptiste. New in CppUnit 1.8.0: ---------------------- In short: - new assertions - new facilities to write custom assertions - new macros to define test case in your fixture - registration of test fixture in named suite - xml & compiler format test result output - a new graphic test runner for the QT library - MFC test runner window is resizable - cppunit as a DLL - Unicode support for MFC test runner. - architecture clean-up: TestResultCollector extracted from TestResult. - architecture clean-up: TestFixture extracted from TestCase. - cookbook and documentation updated. * New assertion (TestAssert.h): CPPUNIT_FAIL(message) : equivalent to CPPUNIT_ASSERT_MESSAGE( message, false ) CPPUNIT_ASSERT_EQUAL_MESSAGE( expectedValue, actualValue, additionalMessage ): behave like CPPUNIT_ASSERT_EQUAL but allow to add some contextual information. * New macros to write test case (HelperMacros.h): CPPUNIT_TEST_EXCEPTION that expect an exception of a specified type to be thrown. CPPUNIT_TEST_FAIL that expect a test to fail. CPPUNIT_TEST_SUITE_NAMED_REGISTRATION to register a suite in a named suite. See cppunittest example for a demo. * TextTestRunner (TextTestRunner.h): -run() returns a boolean indicating is the run was sucessful. -the constructor and setOutputter() allow you do define a specific outputter to print the test result (CompilerOutputter, TextOutputter, XmlOutputter...) -result() provide access to the result of the test run. -eventManager() give access to the TestResult, allowing you to register others TestListener. * TestResult (TestResult.h): - That class has been splitted in two: TestResult and TestResultCollector. - TestResult manages the TestListener (registration and event dispatch), as well as the stop flag indicating if the current test run should be interrupted. All other responsabilites have been moved to TestResultCollector. - TestResult no longer hold the result of the test run (this is done by TestResultCollector which is a TestListener). * TestListener (TestListener.h): - all failures and errors are reported using a single method: virtual void addFailure( const TestFailure &failure ) => the failure object life time is limited to that of the method call. Use TestFailure::isError() to distinguish error from failure. Use TestFailure::clone() to obtain a duplicate of the failure. * New helpers to construct your own assertion (Asserter.h): It is now very easy to create your own assertion macro with failure location. Asserter namespace contains functions used to construct and throw exception to report failure. See Asserter documentation for an example of usage, and examples/cppunittest/XmlUniformiser.h for a real life example. CPPUNIT_SOURCELINE() macro have been added (SourceLine.h). It captures the failure location in a SourceLine object. Use it to write your own macros. Asserter namespace contains functions used to construct and throw exception to report failure. See Asserter documentation for an example of usage, and examples/cppunittest/XmlUniformiser.h for a real life example. * TestListener (TestListener.h): - TestSucesssListener : a simple listener that checks if a test has failed. - TestResultCollector : store all the test result. This class has been extracted from the hold TestResult class. - TextTestProgressListener : print dot on cout to each time a test ends. Letter 'F' and 'E' are printed when a failure or an error occurs. * Output (Outputter.h): - XML output: You can dump the TestResult as an XML document using XmlOutputter. See examples/cppunittest/XmlOutputterTest.cpp for document structure and usage. - Compiler compatible output : CompilerOutputter print the result in a compiler compatible format. You can use your IDE to jump to the first failure. See examples/cppunittest/CppUniTestMain.cpp for an example of usage. - Text output : replace the deprecated TextTestResult. Print the result in a human readable format. * NotEqualException constructor take an additional message (usually used to point out where the difference occured between the expected and actual value) that can be retreived with additionalMessage(). See Asserter documentation for an example of usage. * CppUnit - CppUnit can be compiled as a DLL (WIN32 platform). DLL can be generated by the cppunit_dll.dsp project. You must define the pre-processor symbol CPPUNIT_DLL when linking against CppUnit DLL. See cppunittests examples for an example. * TestRunner - Qt TestRunner : a test runner for the Qt library (http://www.trolltech.com). See examples/qt for an example of use. - MFC TestRunner : the dialog can now be resized. List view column sizes, as well as the dialog size, are saved. Unicode configurations have been added. * Deprecated - TextTestResult : use the test listener TextTestProgressListener and the ouputter TextOuputter instead. - Methods having fileName, lineNumber as parameter. Usually replaced by a similar method that take a SourceLine parameter. Exception and TestAssert are impacted. - TestRegistryFactory::registerFactory( const std::string &name, TestFactory *factory ). You must define the symbol CPPUNIT_ENABLE_SOURCELINE_DEPRECATED to enable old Exception constructor, UNKNOWNFILENAME and UNKNOWNLINENUMBER, as well as function defined in the TestAssert namespace. The exception construction and throwing as been moved to Asserter namespace. * Compatibility break: TestResult has been splitted in two class. TestResultCollector compatibility breaks refer to the methods that were previously in TestResult. - TestListener::addError() was removed. addFailure() is used to report any kind of failure. - TestResultCollector::errors() was removed. Use failures() instead. - TestResultCollector::failures() now reports all kind of failures. - TestResultCollector::failures() returns a const reference. - void TestListener::addFailure( TestFailure *failure ) was removed. - void TestListener::addError( TestFailure *failure ) signature changed. - CPPUNIT_ASSERT_EQUAL_MESSAGE: changed arguments order. 'message' is now the first argument instead of the last (like CPPUNIT_ASSERT_MESSAGE). Notes that CPPUNIT_ASSERT_EQUAL was introduced in release 1.7.3. - directory for TestRunners as moved from cppunitui/ to cppunit/ui/ (concern only users of release 1.7.10) * Bug fix: - test ExceptionTest.testAssignment() don't fail anymore on VC++. See FAQ for detail. |