Boost logo

Boost-Commit :

From: gennadiy.rozental_at_[hidden]
Date: 2007-10-15 22:03:17


Author: rogeeff
Date: 2007-10-15 22:03:16 EDT (Mon, 15 Oct 2007)
New Revision: 40067
URL: http://svn.boost.org/trac/boost/changeset/40067

Log:
proper report for the exceptions in inti_unit_test_suite function
Text files modified:
   trunk/boost/test/impl/framework.ipp | 30 +++++++++++++++++++++++++++---
   1 files changed, 27 insertions(+), 3 deletions(-)

Modified: trunk/boost/test/impl/framework.ipp
==============================================================================
--- trunk/boost/test/impl/framework.ipp (original)
+++ trunk/boost/test/impl/framework.ipp 2007-10-15 22:03:16 EDT (Mon, 15 Oct 2007)
@@ -88,6 +88,20 @@
     counter_t m_tc_amount;
 };
 
+//____________________________________________________________________________//
+
+struct test_init_caller {
+ test_init_caller() : m_manual_test_units( 0 ) {}
+ int operator()()
+ {
+ m_manual_test_units = init_unit_test_suite( framework::master_test_suite().argc, framework::master_test_suite().argv );
+ return 0;
+ }
+
+ // Data members
+ test_suite* m_manual_test_units;
+};
+
 }
 
 // ************************************************************************** //
@@ -240,9 +254,19 @@
     if( !init_unit_test() )
         throw setup_error( BOOST_TEST_L("test tree initialization error" ) );
 #else
- test_suite* s = init_unit_test_suite( argc, argv );
- if( s )
- master_test_suite().add( s );
+ try {
+ boost::execution_monitor em;
+
+ ut_detail::test_init_caller tic;
+
+ em.execute( tic );
+
+ if( tic.m_manual_test_units )
+ master_test_suite().add( tic.m_manual_test_units );
+ }
+ catch( execution_exception const& ex ) {
+ throw setup_error( ex.what() );
+ }
 #endif
 
 #endif


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