Line data Source code
1 : // (C) Copyright Gennadiy Rozental 2001. 2 : // Distributed under the Boost Software License, Version 1.0. 3 : // (See accompanying file LICENSE_1_0.txt or copy at 4 : // http://www.boost.org/LICENSE_1_0.txt) 5 : 6 : // See http://www.boost.org/libs/test for the library home page. 7 : // 8 : // File : $RCSfile$ 9 : // 10 : // Version : $Revision$ 11 : // 12 : // Description : runtime parameters initialization final step 13 : // *************************************************************************** 14 : 15 : #ifndef BOOST_TEST_UTILS_RUNTIME_FINALIZE_HPP 16 : #define BOOST_TEST_UTILS_RUNTIME_FINALIZE_HPP 17 : 18 : // Boost.Test Runtime parameters 19 : #include <boost/test/utils/runtime/parameter.hpp> 20 : #include <boost/test/utils/runtime/argument.hpp> 21 : 22 : // Boost.Test 23 : #include <boost/test/utils/foreach.hpp> 24 : 25 : #include <boost/test/detail/suppress_warnings.hpp> 26 : 27 : namespace boost { 28 : namespace runtime { 29 : 30 : inline void 31 146 : finalize_arguments( parameters_store const& params, runtime::arguments_store& args ) 32 : { 33 8322 : BOOST_TEST_FOREACH( parameters_store::storage_type::value_type const&, v, params.all() ) { 34 4088 : basic_param_ptr param = v.second; 35 : 36 4088 : if( !args.has( param->p_name ) ) { 37 3650 : if( param->p_has_default_value ) 38 2920 : param->produce_default( args ); 39 : 40 3650 : if( !args.has( param->p_name ) ) { 41 730 : BOOST_TEST_I_ASSRT( param->p_optional, 42 : missing_req_arg( param->p_name ) << "Missing argument for required parameter " << param->p_name << "." ); 43 730 : } 44 3650 : } 45 : 46 4088 : if( args.has( param->p_name ) && !!param->p_callback ) 47 0 : param->p_callback( param->p_name ); 48 4088 : } 49 146 : } 50 : 51 : } // namespace runtime 52 : } // namespace boost 53 : 54 : #include <boost/test/detail/enable_warnings.hpp> 55 : 56 : #endif // BOOST_TEST_UTILS_RUNTIME_FINALIZE_HPP