Update of /cvsroot/cppunit/cppunit2/doc
In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv23633/doc
Modified Files:
cpput.dox
Log Message:
- added a list of features todo.
Index: cpput.dox
===================================================================
RCS file: /cvsroot/cppunit/cppunit2/doc/cpput.dox,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** cpput.dox 11 Dec 2005 17:16:08 -0000 1.4
--- cpput.dox 2 Sep 2006 22:08:48 -0000 1.5
***************
*** 2,5 ****
--- 2,7 ----
\mainpage
+ \ref cpput_todo.
+
\section _warning WARNING
***************
*** 12,15 ****
--- 14,18 ----
- \ref section_features
- \ref section_writing_test
+ - \ref section_instantiating_test
- \ref section_assertions
- \ref section_ignore_assertion_failure
***************
*** 39,42 ****
--- 42,67 ----
\section section_writing_test Writing tests
+ \subsection section_instantiating_test Instantiating tests
+ A test case is exposed by instantiating a subclass of CppUT::AbstractTestCase. Each
+ time a test case is executed, the \link CppUT::AbstractTestCase::runTest() runTest()\endlink
+ method is called. This method calls the virtual methods \testCaseSetup, \testCaseRun
+ and \testCaseTearDown.
+ The \testCaseRun and \testCaseTearDown methods are only called if
+ the \testCaseSetup method was successful (no assertion failure, no exception thrown).
+ Only the \testCaseRun method is required to be overridden.
+ It is possible to make assertions in any of those methods. If any exception is thrown
+ by the \testCaseSetup, \testCaseRun or tearDown() methods,
+ or if any of those methods makes an assertion that fails, the test case get a 'failed'
+ status; otherwise it get a 'sucessful' status. The skipped status is never set
+ automatically (see \ref section_skippingtest for detail).
+
+ There is mainly two ways to create test case:
+ - Subclassing CppUT::AbstractTestCase and overridding at least \testCaseRun.
+ - Instantiating CppUT::TestCase, which subclass CppUT::AbstractTestCase, and
+ passing the function to execute in the constructor.
+
+ A test case is usually created using CppUT::makeTestCase() that instantiate
+ CppUT::TestCase.
+
\subsection section_assertions Making assertions
When writing unit test, you check that the tested code behave as expected using
|