Thread: [Cppunit-cvs] cppunit2/doc cpput.dox,1.2,1.3 doxyfile,1.3,1.4
Brought to you by:
blep
From: Baptiste L. <bl...@us...> - 2005-11-13 23:02:28
|
Update of /cvsroot/cppunit/cppunit2/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7919/doc Modified Files: cpput.dox doxyfile Log Message: - added fake_stl so that doxygen can figure out that runtime_error is in std namespace - improved documentation Index: doxyfile =================================================================== RCS file: /cvsroot/cppunit/cppunit2/doc/doxyfile,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** doxyfile 13 Nov 2005 10:12:01 -0000 1.3 --- doxyfile 13 Nov 2005 23:02:16 -0000 1.4 *************** *** 74,78 **** # configuration options related to the input files #--------------------------------------------------------------------------- ! INPUT = ../include/cpptl ../include/cpput ../include/json ../src/cpptl ../src/cpput . # ../src/opentest ../include/opentest FILE_PATTERNS = *.h *.cpp *.inl *.dox --- 74,78 ---- # configuration options related to the input files #--------------------------------------------------------------------------- ! INPUT = ../include/cpptl ../include/cpput ../include/json ../src/cpptl ../src/cpput ./fake_stl . # ../src/opentest ../include/opentest FILE_PATTERNS = *.h *.cpp *.inl *.dox Index: cpput.dox =================================================================== RCS file: /cvsroot/cppunit/cppunit2/doc/cpput.dox,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** cpput.dox 12 Nov 2005 20:55:46 -0000 1.2 --- cpput.dox 13 Nov 2005 23:02:16 -0000 1.3 *************** *** 6,14 **** This is a *very early* documenation release and is very incomplete (including this page). ! \section _intro Introduction CppUnit 2 is a test framework for C++. ! \section _features Features - support aborting and non-aborting assertions - rich collection of assertions --- 6,27 ---- This is a *very early* documenation release and is very incomplete (including this page). ! \section section_toc Table of Contents ! ! - \ref section_intro ! - \ref section_features ! - \ref section_writing_test ! - \ref section_assertions ! - \ref section_ignore_assertion_failure ! - \ref section_logevent ! - \ref section_skippingtest ! - \ref section_projectlinks ! - \ref section_license ! ! ! \section section_intro Introduction CppUnit 2 is a test framework for C++. ! \section section_features Features - support aborting and non-aborting assertions - rich collection of assertions *************** *** 20,30 **** - ... ! \section _plinks Project links - <a HREF="http://cppunit.sourceforge.net">cppunit home</a> - <a HREF="http://www.sourceforge.net/projects/cppunit">cppunit sourceforge project</a> \section _rlinks Related links - <a HREF="http://www.json.org/">JSON</a> Specification and alternate language implementations. --- 33,194 ---- - ... + \section section_writing_test Writing tests + \subsection section_assertions Making assertions + When writing unit test, you check that the tested code behave as expected using + assertions. In CppUnit 2 each assertion is provides in two forms: + - as an aborting assertion + - as a non-aborting assertion (a.k.a. checking assertion) + The difference between aborting and non-aborting assertions is that if an aborting + assertion fails then the test is aborted, while if a non-aborting assertion failed, + then the assertion is logged and the test continue. In CppUnit 1 only aborting assertion + were provided. ! When an aborting assertion failed, it throws the exception ! CppUT::AbortingAssertionException to abort the test. You must ensure that your test ! let this exception pass through (notes that it subclasses std::runtime_error). ! ! All assertions are macros (to capture source location). By convention, ! the following naming prefix are used do distinguish aborting and non-aborting assertion: ! - CPPUT_ASSERT : aborting assertion ! - CPPUT_CHECK : non-arborting assertion ! ! In the table below, all supported assertions without the above prefix will be listed. ! ! <table> ! <tr><td>Suffix</td> <td>Parameters</td> <td>Asserts that...</td> ! <tr><td></td> ! <td>\c expression, [\c message]</td> ! <td> \c expression is \c true </td> ! </tr> ! <tr><td>_EXPR</td> ! <td>\c expression</td> ! <td> \c expression is \c true </td> ! </tr> ! <tr><td>_FALSE</td> ! <td>\c expression, [\c message]</td> ! <td>\c expression is \c false</td> ! </tr> ! <tr><td>_EXPR_FALSE</td> ! <td>\c expression</td> ! <td>\c expression is \c false</td> ! </tr> ! <tr><td>_EQUAL</td> ! <td>\c expected_value, \c actual_value, [\c message]</td> ! <td>\c expected_value == \c actual_value</td> ! </tr> ! <tr><td>_NOT_EQUAL</td> ! <td>\c expected_value, \c actual_value, [\c message]</td> ! <td>\c expected_value != \c actual_value</td> ! </tr> ! <tr><td>_DOUBLE_EQUAL</td> ! <td>\c expected_value, \c actual_value, \c tolerance, [\c message]</td> ! <td>\c fabs(\c expected_value - \c actual_value) <= \c tolerance</td> ! </tr> ! <tr><td>_THROW</td> ! <td>\c expression, \c ExpectedExceptionType</td> ! <td>\c expression throws an exception of type ExpectedExceptionType</td> ! </tr> ! <tr><td>_NO_THROW</td> ! <td>\c expression</td> ! <td>\c expression does not throw any exceptions</td> ! </tr> ! <tr><td>_ASSERTION_FAIL_MESSAGE</td> ! <td>\c assertion, \c message</td> ! <td>\c assertion fails</td> ! </tr> ! <tr><td>_ASSERTION_FAIL</td> ! <td>\c assertion</td> ! <td>\c assertion fails</td> ! </tr> ! <tr><td>_ASSERTION_PASS_MESSAGE</td> ! <td>\c assertion, \c message</td> ! <td>\c assertion passes</td> ! </tr> ! <tr><td>_ASSERTION_PASS</td> ! <td>\c assertion</td> ! <td>\c assertion passes</td> ! </tr> ! <tr><td>STR_START</td> ! <td>\c pattern, \c actual_string</td> ! <td>\c actual_string starts with \c pattern</td> ! </tr> ! <tr><td>STR_END</td> ! <td>\c pattern, \c actual_string</td> ! <td>\c actual_string ends with \c pattern</td> ! </tr> ! <tr><td>STR_END</td> ! <td>\c pattern, \c actual_string</td> ! <td>\c actual_string ends with \c pattern</td> ! </tr> ! <tr><td>STR_CONTAIN</td> ! <td>\c pattern, \c actual_string</td> ! <td>\c actual_string contains \c pattern</td> ! </tr> ! <tr><td>STR_EQUAL</td> ! <td>\c pattern, \c actual_string</td> ! <td>\c actual_string contains \c pattern</td> ! </tr> ! <tr><td>_SEQUENCE_EQUAL</td> ! <td>\c expected_ordered_sequence, \c actual_ordered_sequence</td> ! <td>\c expected_ordered_sequence and \c actual_ordered_sequence contains ! the same value in the same order.</td> ! </tr> ! <tr><td>_SET_EQUAL</td> ! <td>\c expected_unordered, \c actual_unordered_sequence</td> ! <td>\c expected_ordered_sequence and \c actual_ordered_sequence contains ! the same value regardless of the order.</td> ! </tr> ! <tr><td>_STL_SEQUENCE_EQUAL</td> ! <td>\c expected_ordered_sequence, \c actual_ordered_sequence</td> ! <td>\c expected_ordered_sequence and \c actual_ordered_sequence contains ! the same value in the same order.</td> ! </tr> ! <tr><td>_STL_SET_EQUAL</td> ! <td>\c expected_unordered, \c actual_unordered_sequence</td> ! <td>\c expected_ordered_sequence and \c actual_ordered_sequence contains ! the same value regardless of the order.</td> ! </tr> ! </table> ! ! See module \ref group_assertions for the list of assertion macros. ! ! [[notes: add double brace warning about macro parameter]] ! ! \subsection section_ignore_assertion_failure Ignoring specific assertion failures ! ! During a test, it is also possible to ignore an assertion failure. This is useful ! for example when doing some large refactoring that takes days and cause some test to break ! temporarily. With this feature, it is possible to indicate that some assertions are expected ! to fail and the test should not be considered to have failed. The assertion failure is ! still logged. ! ! Use CPPUT_IGNORE_FAILURE() to ignore an assertion failure. See ignore_failure_demo for ! an example. ! ! \subsection section_logevent Loggin events ! ! Often the same set of assertions is used in a loop over some input data. If a failure ! occurs, it is not possible to know on which iteration the failure occurred (unless the ! iteration was specified in the optional \c message parameter of the assertion). ! ! CppUT::log() can be used to log a context. The list of log events and assertion failures ! is seen as a single test event sequence. See log_demo for an example. ! ! \subsection section_skippingtest Skipping a test ! ! It is possible to force a test to be skipped using CPPUT_SKIP_TEST. The test status will ! be set to CppUT::TestStatus::skipped unless a failure occurred before. ! ! Notes that a SkipTestException exception (a subclass of std::runtime_error) is thrown ! to abort the test. ! ! \section section_projectlinks Project links - <a HREF="http://cppunit.sourceforge.net">cppunit home</a> - <a HREF="http://www.sourceforge.net/projects/cppunit">cppunit sourceforge project</a> + + \section _rlinks Related links - <a HREF="http://www.json.org/">JSON</a> Specification and alternate language implementations. *************** *** 32,38 **** - <a HREF="http://www.cl.cam.ac.uk/~mgk25/unicode.html">UTF-8 and Unicode FAQ</a>. ! \section _license License ! This documentation is in public domain. The CppTL library is in public domain. The CppUT and OpenTest library are under the LGPL with run-time exception. --- 196,203 ---- - <a HREF="http://www.cl.cam.ac.uk/~mgk25/unicode.html">UTF-8 and Unicode FAQ</a>. ! ! \section section_license License The CppTL library is in public domain. + The CppUT and OpenTest library are under the LGPL with run-time exception. *************** *** 42,46 **** /*! \defgroup group_assertions Assertions ! */ /*! \defgroup group_custom_assertions Creating new assertions --- 207,211 ---- /*! \defgroup group_assertions Assertions ! */ /*! \defgroup group_custom_assertions Creating new assertions |