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)
6 // See http://www.boost.org/libs/test for the library home page.
10 // Version : $Revision$
12 // Description : runtime parameters initialization final step
13 // ***************************************************************************
15 #ifndef BOOST_TEST_UTILS_RUNTIME_FINALIZE_HPP
16 #define BOOST_TEST_UTILS_RUNTIME_FINALIZE_HPP
18 // Boost.Test Runtime parameters
19 #include <boost/test/utils/runtime/parameter.hpp>
20 #include <boost/test/utils/runtime/argument.hpp>
23 #include <boost/test/utils/foreach.hpp>
25 #include <boost/test/detail/suppress_warnings.hpp>
31 finalize_arguments( parameters_store const& params, runtime::arguments_store& args )
33 BOOST_TEST_FOREACH( parameters_store::storage_type::value_type const&, v, params.all() ) {
34 basic_param_ptr param = v.second;
36 if( !args.has( param->p_name ) ) {
37 if( param->p_has_default_value )
38 param->produce_default( args );
40 if( !args.has( param->p_name ) ) {
41 BOOST_TEST_I_ASSRT( param->p_optional,
42 missing_req_arg( param->p_name ) << "Missing argument for required parameter " << param->p_name << "." );
46 if( args.has( param->p_name ) && !!param->p_callback )
47 param->p_callback( param->p_name );
51 } // namespace runtime
54 #include <boost/test/detail/enable_warnings.hpp>
56 #endif // BOOST_TEST_UTILS_RUNTIME_FINALIZE_HPP