00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef MOCKPP_SELECTUNITTESTFRAMEWORK_H
00031 #define MOCKPP_SELECTUNITTESTFRAMEWORK_H
00032
00054 #ifdef DOXYGEN_SHOULD_INCLUDE_THIS // make doxygen happily include docs
00055 #define MOCKPP_USE_CXXTEST
00056 #define MOCKPP_USE_CPPUNIT
00057 #define MOCKPP_USE_BOOSTTEST
00058 #endif
00059
00075
00076 #if defined(MOCKPP_USE_CXXTEST)
00077
00078
00079 # define MOCKPP_DERIVE_PUBLIC_UNITFRAMEWORK : public CXXTEST_NS::TestSuite
00080
00081 #define MOCKPP_TESTMETHOD_DECL
00082
00083 #define CXXTEST_HAVE_STD
00084 #ifndef CXXTEST_RUNNING
00085 #define CXXTEST_RUNNING
00086 #endif
00087
00088 #define _CXXTEST_HAVE_STD
00089
00090 #ifndef MOCKPP_NO_EXCEPTIONS
00091 #define CXXTEST_ABORT_TEST_ON_FAIL
00092 #define _CXXTEST_HAVE_EH
00093 #endif
00094
00095 #include <cxxtest/TestListener.h>
00096 #include <cxxtest/TestTracker.h>
00097 #include <cxxtest/RealDescriptions.h>
00098
00099 #include <mockpp/framework/CxxTestSupport.h>
00100
00101
00102 #elif defined(MOCKPP_USE_CPPUNIT)
00103
00104
00105 #define MOCKPP_TESTMETHOD_DECL
00106
00107 # include <cppunit/extensions/HelperMacros.h>
00108 # define MOCKPP_DERIVE_PUBLIC_UNITFRAMEWORK : public CppUnit::TestFixture
00109
00110
00111 #elif defined(MOCKPP_USE_BOOSTTEST)
00112
00113
00114
00115
00116
00117
00118
00119
00120 # include <boost/test/unit_test.hpp>
00121 # include <cstdio>
00122
00123 # define MOCKPP_TESTMETHOD_DECL static
00124
00125 # define MOCKPP_DERIVE_PUBLIC_UNITFRAMEWORK
00126
00127 #define MOCKPP_JOIN( X, Z ) MOCKPP_DO_JOIN3( X, __, Z )
00128 #define MOCKPP_DO_JOIN3( X, Y, Z ) X##Y##Z
00129
00135 #define MOCKPP_BOOST_TEST(class_name, func_name) \
00136 BOOST_AUTO_TEST_CASE( MOCKPP_JOIN(class_name, func_name) ) \
00137 { \
00138 \
00139 class_name :: func_name(); \
00140 }
00141
00142
00143 #else
00144
00145
00146 # pragma message ("No unittest framework available at compile time")
00147 # define MOCKPP_DERIVE_PUBLIC_UNITFRAMEWORK
00148
00149 #endif // frameworks
00150
00151 #endif // MOCKPP_SELECTUNITTESTFRAMEWORK_H