CppUnit - C++ port of JUnit Code
Brought to you by:
blep
New in CppUnit 1.7.0
--------------------
* New macros in 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.
* Fail with arbitrary message: CPPUNIT_FAIL
* 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.
* TextTestRunner now return a boolean indicating is the run was sucessful. You
can also specify a TextTestResult in the constructor and access the result
with result().
* Helpers to construct your own assertion
It is now very easy to create your own assertion macro with failure
location.
CPPUNIT_SOURCELINE() macro have been added. It capture the failure location
is a SourceLine object.
Asserter namespace contains functions used to construct and throw exception
to report failure. See Asserter documentation for an example of usage.
* XML Output
You can dump the TestResult as an XML document using XmlTestResultOutputter.
See examples/cppunittest/XmlTestResultOutputterTest.cpp for document
structure and usage.
* Deprecated
- Methods having fileName, lineNumber as parameter. Usually replaced by
a similar method that take a SourceLine parameter. Exception and
TestAssert are impacted.
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:
- TestListener::addError() was removed. addFailure() is used to report
any kind of failure.
- TestResult::errors() was removed. Use failures() instead.
- TestResult::failures() now reports all kind of failures.
- TestResult::failures() returns a const reference.
- TestAssert ### to detail ###
* Bug fix:
- test ExceptionTest.testAssignment() don't fail anymore on VC++. See FAQ
for detail.
New in CppUnit 1.6.1
--------------------
* This is a bug-fixing release.
New in CppUnit 1.6.0
--------------------
* All CppUnit macros now begin with "CPPUNIT_".
Macros CU_TEST_SUITE, CU_TEST, CU_TEST_SUITE_END, CU_TEST_SUB_SUITE,
and CU_TEST_SUITE_REGISTRATION are renamed but are otherwise unchanged;
they take the same arguments, and have the same effect. The old-style
macros can be used if your sources #define CPPUNIT_ENABLE_CU_TEST_MACROS
to 1 before including any CppUnit headers.
Macros assert, assertEqual, and assertDoublesEqual, have been replaced
by CPPUNIT_ASSERT, CPPUNIT_ASSERT_EQUAL, and CPPUNIT_ASSERT_DOUBLES_EQUAL,
respectively. Macro assertLongsEqual is replaced by CPPUNIT_ASSERT_EQUAL.
The old assert macros can be used if your sources #define
CPPUNIT_ENABLE_NAKED_ASSERT to 1 before including any CppUnit headers.
The old macro names are deprecated and will vanish in a future version
of CppUnit.
* Equality assertion CPPUNIT_ASSERT_EQUAL(expected,actual) can test
any type of expression. The types of "expected" and "actual" must
be the same; use a cast if necessary.
* Equality tested using CPPUNIT_ASSERT_EQUAL may be re-defined using
a traits class. Ditto for the string representation used in the
diagnostic messages.
* New assertion with arbitrary message: CPPUNIT_ASSERT_MESSAGE.
* A test case obtained using class TestCaller may check that
a particular exception is thrown.
* CppUnit has a test suite for itself!
* VC++ integration for MFC TestRunner.