Boost logo

Boost-Commit :

From: gennadiy.rozental_at_[hidden]
Date: 2007-10-22 00:02:54


Author: rogeeff
Date: 2007-10-22 00:02:53 EDT (Mon, 22 Oct 2007)
New Revision: 40273
URL: http://svn.boost.org/trac/boost/changeset/40273

Log:
added missing export for framework::get
added line number to the name of the TU registrar, allowing to restart test suites within same module
test_suite::size() implemented to provide an access to the suite size
Text files modified:
   trunk/boost/test/framework.hpp | 25 ++-----------------------
   trunk/boost/test/unit_test_suite.hpp | 39 ++++++++++-----------------------------
   trunk/boost/test/unit_test_suite_impl.hpp | 9 +++++----
   3 files changed, 17 insertions(+), 56 deletions(-)

Modified: trunk/boost/test/framework.hpp
==============================================================================
--- trunk/boost/test/framework.hpp (original)
+++ trunk/boost/test/framework.hpp 2007-10-22 00:02:53 EDT (Mon, 22 Oct 2007)
@@ -68,9 +68,9 @@
 {
     return static_cast<UnitType&>( get( id, (test_unit_type)UnitType::type ) );
 }
-test_unit& get( test_unit_id, test_unit_type );
+BOOST_TEST_DECL test_unit& get( test_unit_id, test_unit_type );
 #else
-test_unit& get( test_unit_id, test_unit_type );
+BOOST_TEST_DECL test_unit& get( test_unit_id, test_unit_type );
 template<typename UnitType>
 UnitType& get( test_unit_id id )
 {
@@ -109,26 +109,5 @@
 
 #include <boost/test/detail/enable_warnings.hpp>
 
-// ***************************************************************************
-// Revision History :
-//
-// $Log$
-// Revision 1.5 2006/03/19 07:27:52 rogeeff
-// streamline test setup error message
-//
-// Revision 1.4 2005/12/14 05:08:44 rogeeff
-// dll support introduced
-//
-// Revision 1.3 2005/03/24 04:02:32 rogeeff
-// portability fixes
-//
-// Revision 1.2 2005/03/23 21:02:10 rogeeff
-// Sunpro CC 5.3 fixes
-//
-// Revision 1.1 2005/02/20 08:27:05 rogeeff
-// This a major update for Boost.Test framework. See release docs for complete list of fixes/updates
-//
-// ***************************************************************************
-
 #endif // BOOST_TEST_FRAMEWORK_HPP_020805GER
 

Modified: trunk/boost/test/unit_test_suite.hpp
==============================================================================
--- trunk/boost/test/unit_test_suite.hpp (original)
+++ trunk/boost/test/unit_test_suite.hpp 2007-10-22 00:02:53 EDT (Mon, 22 Oct 2007)
@@ -25,10 +25,10 @@
 // ************** Non-auto (explicit) test case interface ************** //
 // ************************************************************************** //
 
-#define BOOST_TEST_CASE( function ) \
-boost::unit_test::make_test_case( boost::unit_test::callback0<>(function), BOOST_TEST_STRINGIZE( function ) )
-#define BOOST_CLASS_TEST_CASE( function, tc_instance ) \
-boost::unit_test::make_test_case((function), BOOST_TEST_STRINGIZE( function ), tc_instance )
+#define BOOST_TEST_CASE( test_function ) \
+boost::unit_test::make_test_case( boost::unit_test::callback0<>(test_function), BOOST_TEST_STRINGIZE( test_function ) )
+#define BOOST_CLASS_TEST_CASE( test_function, tc_instance ) \
+boost::unit_test::make_test_case((test_function), BOOST_TEST_STRINGIZE( test_function ), tc_instance )
 
 // ************************************************************************** //
 // ************** BOOST_TEST_SUITE ************** //
@@ -43,7 +43,7 @@
 
 #define BOOST_AUTO_TEST_SUITE( suite_name ) \
 namespace suite_name { \
-BOOST_AUTO_TC_REGISTRAR( suite_name )( BOOST_STRINGIZE( suite_name ) ); \
+BOOST_AUTO_TU_REGISTRAR( suite_name )( BOOST_STRINGIZE( suite_name ) ); \
 /**/
 
 // ************************************************************************** //
@@ -60,7 +60,7 @@
 // ************************************************************************** //
 
 #define BOOST_AUTO_TEST_SUITE_END() \
-BOOST_AUTO_TC_REGISTRAR( BOOST_JOIN( end_suite, __LINE__ ) )( 1 ); \
+BOOST_AUTO_TU_REGISTRAR( BOOST_JOIN( end_suite, __LINE__ ) )( 1 ); \
 } \
 /**/
 
@@ -98,7 +98,7 @@
                                                                         \
 struct BOOST_AUTO_TC_UNIQUE_ID( test_name ) {}; \
                                                                         \
-BOOST_AUTO_TC_REGISTRAR( test_name )( \
+BOOST_AUTO_TU_REGISTRAR( test_name )( \
     boost::unit_test::make_test_case( \
         &BOOST_AUTO_TC_INVOKER( test_name ), #test_name ), \
     boost::unit_test::ut_detail::auto_tc_exp_fail< \
@@ -133,7 +133,7 @@
     } \
 }; \
                                                                         \
-BOOST_AUTO_TC_REGISTRAR( test_name )( \
+BOOST_AUTO_TU_REGISTRAR( test_name )( \
     boost::unit_test::ut_detail::template_test_case_gen< \
         BOOST_AUTO_TC_INVOKER( test_name ),TL >( \
           BOOST_STRINGIZE( test_name ) ) ); \
@@ -169,8 +169,8 @@
 // ************** Auto registration facility helper macros ************** //
 // ************************************************************************** //
 
-#define BOOST_AUTO_TC_REGISTRAR( test_name ) \
-static boost::unit_test::ut_detail::auto_test_unit_registrar BOOST_JOIN( test_name, _registrar )
+#define BOOST_AUTO_TU_REGISTRAR( test_name ) \
+static boost::unit_test::ut_detail::auto_test_unit_registrar BOOST_JOIN( BOOST_JOIN( test_name, _registrar ), __LINE__ )
 #define BOOST_AUTO_TC_INVOKER( test_name ) BOOST_JOIN( test_name, _invoker )
 #define BOOST_AUTO_TC_UNIQUE_ID( test_name ) BOOST_JOIN( test_name, _id )
 
@@ -205,24 +205,5 @@
 
 //____________________________________________________________________________//
 
-// ***************************************************************************
-// Revision History :
-//
-// $Log$
-// Revision 1.36 2006/03/19 12:23:21 rogeeff
-// eliminate warning
-//
-// Revision 1.35 2006/02/06 10:04:55 rogeeff
-// BOOST_TEST_MODULE - master test suite name
-//
-// Revision 1.34 2006/01/28 07:02:57 rogeeff
-// allow multiple global fixtures
-//
-// Revision 1.33 2005/12/14 05:24:55 rogeeff
-// dll support introduced
-// split into 2 files
-//
-// ***************************************************************************
-
 #endif // BOOST_TEST_UNIT_TEST_SUITE_HPP_071894GER
 

Modified: trunk/boost/test/unit_test_suite_impl.hpp
==============================================================================
--- trunk/boost/test/unit_test_suite_impl.hpp (original)
+++ trunk/boost/test/unit_test_suite_impl.hpp 2007-10-22 00:02:53 EDT (Mon, 22 Oct 2007)
@@ -120,14 +120,15 @@
     enum { type = tut_suite };
 
     // Constructor
- explicit test_suite( const_string ts_name );
+ explicit test_suite( const_string ts_name );
 
     // test unit list management
- void add( test_unit* tu, counter_t expected_failures = 0, unsigned timeout = 0 );
- void add( test_unit_generator const& gen, unsigned timeout = 0 );
+ void add( test_unit* tu, counter_t expected_failures = 0, unsigned timeout = 0 );
+ void add( test_unit_generator const& gen, unsigned timeout = 0 );
 
     // access methods
- test_unit_id get( const_string tu_name ) const;
+ test_unit_id get( const_string tu_name ) const;
+ size_t size() const { return m_members.size(); }
 
 protected:
     friend BOOST_TEST_DECL


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk