Thread: [Mockpp-commits] mockpp/mockpp/docs/en dev_test_framework.docbook,1.4,1.5 index.docbook,1.37,1.38
Brought to you by:
ewald-arnold
From: Ewald A. <ewa...@us...> - 2006-01-03 15:12:46
|
Update of /cvsroot/mockpp/mockpp/mockpp/docs/en In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4137/mockpp/docs/en Modified Files: dev_test_framework.docbook index.docbook Log Message: fix docs Index: index.docbook =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/docs/en/index.docbook,v retrieving revision 1.37 retrieving revision 1.38 diff -u -d -r1.37 -r1.38 --- index.docbook 29 Dec 2005 19:29:51 -0000 1.37 +++ index.docbook 3 Jan 2006 15:12:34 -0000 1.38 @@ -9,12 +9,12 @@ <!ENTITY mockpp '<application>mockpp</application>' > <!ENTITY cppunit '<application>CppUnit</application>' > <!ENTITY cxxtest '<application>CxxTest</application>' > - <!ENTITY boosttest '<application>Boost.Test</application>' > + <!ENTITY boost.test '<application>Boost.Test</application>' > <!ENTITY cygwin '<application>Cygwin</application>' > <!ENTITY copyyears '2002-2006' > <!ENTITY mockpp_email 'mockpp at ewald-arnold dot de' > <!ENTITY release_date '<pubdate>Published: <?dbtimestamp format="Y-m-d"?></pubdate>' > - <!ENTITY release_info '<releaseinfo>1.11.00</releaseinfo>' > + <!ENTITY release_info '<releaseinfo>1.11.01</releaseinfo>' > <!ENTITY chap_bookinfo SYSTEM 'bookinfo.docbook' > <!ENTITY chap_intro SYSTEM 'intro.docbook' > Index: dev_test_framework.docbook =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/docs/en/dev_test_framework.docbook,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- dev_test_framework.docbook 28 Dec 2005 09:23:30 -0000 1.4 +++ dev_test_framework.docbook 3 Jan 2006 15:12:34 -0000 1.5 @@ -8,8 +8,9 @@ leaks since the compiler adds code to destruct automatic variables.</para> <para>The following section lists frameworks which have actually been used to -verify the correctness of &mockpp;. Or at least they are known to work -properly.</para> +verify the correctness of &mockpp;. Each of the frameworks supports the automatic +registration of tests. +Additionally &mockpp; contains some specialised macros for better integration.</para> <sect2 id="framework-cppunit"> <title>CppUnit</title> @@ -43,6 +44,8 @@ ... } +CPPUNIT_TEST_SUITE_REGISTRATION (AssertMo_test); + </programlisting> </sect2> @@ -81,30 +84,89 @@ void test_A_includes(); }; +void AssertMo_test::test_A_includes() +{ + ... +} + MOCKPP_CXXTEST_SUITE_REGISTRATION( AssertMo_test ); MOCKPP_CXXTEST(AssertMo_test, test_A_includes); +</programlisting> + +</sect2> + +<sect2 id="framework-boost"> +<title>Boost.Test</title> + +<para>Boost.Test does not need test methods which reside in classes. It is also +possible to use free functions. On the other hand there is no mechanism +with <function>setup()</function>/<function>teardown()</function> like in +&cppunit; or &cxxtest;. Another advantage of &boost.test; is the possibility +to catch system exceptions or limit execution time with timeouts.</para> + +<programlisting> + +void test_freeFunction() +{ + ... +} + +class AssertMo_test +{ + public: + + static void test_A_includes(); +}; + void AssertMo_test::test_A_includes() { ... } +void test_freeFunction() +{ + ... +} + +MOCKPP_BOOST_TEST(test_freeFunction); +MOCKPP_BOOST_TEST(AssertMo_test::test_A_includes); + </programlisting> </sect2> -<sect2 id="framework-boost"> -<title>Boost.Test</title> +<sect2 id="framework-select"> +<title>Selecting a Framework at Compile Time</title> -<para>TBD</para> +<para>Since each of the frameworks has its special advantage it may be necessary to +switch at compile time under different environments. On a desktop computer +&boost.test; may be appropriate but for special tests on embedded platforms you +may prefer &cxxtest;.</para> -<!-- -As opposed to the previous frameworks &boosttest; does not use +<para>&mockpp; uses some compiler switches and conditional macros to support the +formerly mentioned frameworks. The tests itself remain unchanged. Only the method +to register the tests and the invocation within <function>main()</function> +differs. Please see the various tests files <filename>*_tests.cpp</filename> and +<filename>mock_test.cpp</filename> in the <filename>tests</filename> directory. +Depending on the definition in the configuration file one of the following macros +is used to generate the according code. +<filename>SelectUnittestFramework.h</filename> contains all the definitions and +includes the needed header files.</para> <programlisting> -</programlisting> ---> +#include <mockpp/SelectUnittestFramework.h> + +#if defined (MOCKPP_USE_CXXTEST) + +#elif defined(MOCKPP_USE_BOOSTTEST) + +#elif defined(MOCKPP_USE_CXXTEST) + +#endif + +</programlisting> </sect2> |