diff --git a/include/boost/test/impl/framework.ipp b/include/boost/test/impl/framework.ipp index 517395ae5d..6f21bb22cf 100644 --- a/include/boost/test/impl/framework.ipp +++ b/include/boost/test/impl/framework.ipp @@ -333,6 +333,16 @@ public: ~framework_impl() { clear(); } + void reset() + { + clear(); + m_master_test_suite = 0; + m_curr_test_case = INV_TEST_UNIT_ID; + m_next_test_case_id = MIN_TEST_CASE_ID; + m_next_test_suite_id = MIN_TEST_SUITE_ID; + m_test_in_progress = false; + } + void clear() { while( !m_test_units.empty() ) { @@ -643,8 +653,20 @@ apply_filters( test_unit_id master_tu_id ) // ************************************************************************** // void +reset() +{ + reset_observers(); + s_frk_impl().reset(); +} + +void init( init_unit_test_func init_func, int argc, char* argv[] ) { + if( s_frk_impl().m_is_initialized ) + { + reset(); + } + runtime_config::init( argc, argv ); // set the log level and format diff --git a/include/boost/test/impl/unit_test_parameters.ipp b/include/boost/test/impl/unit_test_parameters.ipp index 8127278af5..4fc12f5f59 100644 --- a/include/boost/test/impl/unit_test_parameters.ipp +++ b/include/boost/test/impl/unit_test_parameters.ipp @@ -152,6 +152,30 @@ namespace runtime_config { namespace { // framework parameters and corresponding command-line arguments +#ifdef BOOST_TEST_USE_QUALIFIED_COMMANDLINE_ARGUMENTS +std::string AUTO_START_DBG = "boost.test.auto_start_dbg"; +std::string BREAK_EXEC_PATH = "boost.test.break_exec_path"; +std::string BUILD_INFO = "boost.test.build_info"; +std::string CATCH_SYS_ERRORS = "boost.test.catch_system_errors"; +std::string COLOR_OUTPUT = "boost.test.color_output"; +std::string DETECT_FP_EXCEPT = "boost.test.detect_fp_exceptions"; +std::string DETECT_MEM_LEAKS = "boost.test.detect_memory_leaks"; +std::string LIST_CONTENT = "boost.test.list_content"; +std::string LOG_FORMAT = "boost.test.log_format"; +std::string LOG_LEVEL = "boost.test.log_level"; +std::string LOG_SINK = "boost.test.log_sink"; +std::string OUTPUT_FORMAT = "boost.test.output_format"; +std::string RANDOM_SEED = "boost.test.random"; +std::string REPORT_FORMAT = "boost.test.report_format"; +std::string REPORT_LEVEL = "boost.test.report_level"; +std::string REPORT_SINK = "boost.test.report_sink"; +std::string RESULT_CODE = "boost.test.result_code"; +std::string TESTS_TO_RUN = "boost.test.run_test"; +std::string SAVE_TEST_PATTERN = "boost.test.save_pattern"; +std::string SHOW_PROGRESS = "boost.test.show_progress"; +std::string USE_ALT_STACK = "boost.test.use_alt_stack"; +std::string WAIT_FOR_DEBUGGER = "boost.test.wait_for_debugger"; +#else std::string AUTO_START_DBG = "auto_start_dbg"; std::string BREAK_EXEC_PATH = "break_exec_path"; std::string BUILD_INFO = "build_info"; @@ -174,6 +198,7 @@ std::string SAVE_TEST_PATTERN = "save_pattern"; std::string SHOW_PROGRESS = "show_progress"; std::string USE_ALT_STACK = "use_alt_stack"; std::string WAIT_FOR_DEBUGGER = "wait_for_debugger"; +#endif static const_string parameter_2_env_var( const_string param_name ) @@ -262,6 +287,8 @@ init( int& argc, char** argv ) { using namespace cla; + s_cla_parser.clear(); + try { if( s_cla_parser.num_params() != 0 ) s_cla_parser.reset(); diff --git a/include/boost/test/utils/runtime/cla/parser.hpp b/include/boost/test/utils/runtime/cla/parser.hpp index d1b898e7f4..de5e09ad76 100644 --- a/include/boost/test/utils/runtime/cla/parser.hpp +++ b/include/boost/test/utils/runtime/cla/parser.hpp @@ -128,6 +128,9 @@ class parser { void usage( out_stream& ostr ); void help( out_stream& ostr ); + // clear + void clear(); + private: argument const& valid_argument( cstring string_id ) const; diff --git a/include/boost/test/utils/runtime/cla/parser.ipp b/include/boost/test/utils/runtime/cla/parser.ipp index b3b35c9f83..5eed6d553f 100644 --- a/include/boost/test/utils/runtime/cla/parser.ipp +++ b/include/boost/test/utils/runtime/cla/parser.ipp @@ -258,6 +258,14 @@ parser::reset() //____________________________________________________________________________// +BOOST_RT_PARAM_INLINE void +parser::clear() +{ + m_parameters.clear(); +} + +//____________________________________________________________________________// + } // namespace cla } // namespace BOOST_RT_PARAM_NAMESPACE