File indexing completed on 2025-01-18 09:52:42
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #ifndef BOOST_TEST_UTILS_RUNTIME_FINALIZE_HPP
0016 #define BOOST_TEST_UTILS_RUNTIME_FINALIZE_HPP
0017
0018
0019 #include <boost/test/utils/runtime/parameter.hpp>
0020 #include <boost/test/utils/runtime/argument.hpp>
0021
0022
0023 #include <boost/test/utils/foreach.hpp>
0024
0025 #include <boost/test/detail/suppress_warnings.hpp>
0026
0027 namespace boost {
0028 namespace runtime {
0029
0030 inline void
0031 finalize_arguments( parameters_store const& params, runtime::arguments_store& args )
0032 {
0033 BOOST_TEST_FOREACH( parameters_store::storage_type::value_type const&, v, params.all() ) {
0034 basic_param_ptr param = v.second;
0035
0036 if( !args.has( param->p_name ) ) {
0037 if( param->p_has_default_value )
0038 param->produce_default( args );
0039
0040 if( !args.has( param->p_name ) ) {
0041 BOOST_TEST_I_ASSRT( param->p_optional,
0042 missing_req_arg( param->p_name ) << "Missing argument for required parameter " << param->p_name << "." );
0043 }
0044 }
0045
0046 if( args.has( param->p_name ) && !!param->p_callback )
0047 param->p_callback( param->p_name );
0048 }
0049 }
0050
0051 }
0052 }
0053
0054 #include <boost/test/detail/enable_warnings.hpp>
0055
0056 #endif