CppUnit - C++ port of JUnit Code
Brought to you by:
blep
* CppUnit:
- [DONE] Update TextTestRunner to use Test::findTest()
- [DONE] Introduce a new generic CppUnit::TestRunner
- [DONE] Update MfcTestRunner to use Test::findTest()
- Update MfcTestRunner to use TestPath to store test in the registry
- [DONE] Update QtTestRunner to use findTest()
- [DONE] Include DllPlugInTester, and update to use findTest() and TestPath().
- [DONE] Add startSuite() and endSuite() to TestListener and TestResult
- Add TestResult::protectedRun( ProtectedTest * ) to allow custom exception
- [DONE] Add a global set up decorator for all test run to TestResult
=> extends TestListener: startTestRun(), endTestRun().
- [DONE] Change CompilerOutputter to be customized with parameter instead of subclassing:
provide a default string to the constructor that indicates the error report format:
%p => full path (D:\prg\..\File.cpp)
%f => just the file name (File.cpp)
%l => line (123)
For VC++: "%p(%l):"
For GCC: "%f:%l:"
String could be defined in the configuration file, and be guessed by configure (?)
Assume GCC if not VC++ ?
Notes: gcc error format:
g++ -DHAVE_CONFIG_H -I. -I. -I../../config -I../../include -I../../include -g -O2 -c TextOutputter.cpp -Wp,-MD,.deps/TextOutputter.TPlo -fPIC -DPIC
TextOutputter.cpp:5: cppunit/TextOutputter.h: No such file or directory
- [DISCARDED: UTF8 is enough] True Unicode support:
- Introduce a new CppUnit::String class. This class allow implicit construction from
const char *, std::string, wchar_t * and std::wstring. Provides accessor str() and
wstr() to retreive the string as either ANSI or UNICODE string.
- Update Asserter to use String instead of std::string
- Deprecate Exception::what(), and add String Exception::message().
- Compatibility break for NotEqualException::expected(), actual() and additionalInfo().
- Update MfcTestRuner to use wstr() in Unicode build => introduce a utility function
toCString( CppUnit::String &) that returns a CString using the appropriate method.
- [DONE] Wrap test plug-in suite retreival in a TestPlugInSuite.
- [DONE] CrossPlatform TestPlugInSuite and TestPlugInInterface.
- [DONE] CrossPlatform test runner for TestPlugIn.
- Advanced command line support for the plug-in runner
(--xml, --compiler...) + plug-in parameter support.
- STL orthodox template for container elements.
* UnitTest
- add tests for XmlOutputter::setStyleSheet (current assertion macro strip <?...> when
testing )
- add tests for TestRunner, TextUi::TestRunner, CompilerOutputter.
- add tests for test plug-in
* VC++ TestRunner:
- Make it possible to specify the registry path where settings are stored.
Current method use the path defined in the CWinApp. This does not work
for console application
- Add "details" field to show detail of the selected failed test:
- suite and test name,
- failure message. If possible separate "was" and "expected" in the
forthcoming assertEquals() to make comparison easier,
- source file location.
* BugFix: CompilerOutputter::wrap(), bug when wrapping empty line in the middle
of a text (they disappear).
* Documentation:
CookBook:
- how to create simple test cases (with CppUnit namespace)
- test case using only CPPUINT_ASSERT
- test case using CPPUNIT_ASSERT_EQUAL
- advanced assertions with the CPPUNIT_ASSERT_MESSAGE
- Helper Macros for convenience
- Creating a suite
- Composing a suite from more suites (i.e. compose tests for n modules to
form a big test for the whole program)
- customizing output using an user defined TestListener
- how to write the TestListener (subclass of TestListener)
- how to hook it in
- how to use the GUI
- MSVC++ special stuff
- other custmization stuff I haven't understood yet
CppUnit: architecture overview.
- need to merge cookbook with Phil Verghese's contribution.