Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:52:42

0001 //  (C) Copyright Gennadiy Rozental 2001.
0002 //  Distributed under the Boost Software License, Version 1.0.
0003 //  (See accompanying file LICENSE_1_0.txt or copy at
0004 //  http://www.boost.org/LICENSE_1_0.txt)
0005 
0006 //  See http://www.boost.org/libs/test for the library home page.
0007 //
0008 //  File        : $RCSfile$
0009 //
0010 //  Version     : $Revision$
0011 //
0012 //  Description : runtime parameters initialization final step
0013 // ***************************************************************************
0014 
0015 #ifndef BOOST_TEST_UTILS_RUNTIME_FINALIZE_HPP
0016 #define BOOST_TEST_UTILS_RUNTIME_FINALIZE_HPP
0017 
0018 // Boost.Test Runtime parameters
0019 #include <boost/test/utils/runtime/parameter.hpp>
0020 #include <boost/test/utils/runtime/argument.hpp>
0021 
0022 // Boost.Test
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 } // namespace runtime
0052 } // namespace boost
0053 
0054 #include <boost/test/detail/enable_warnings.hpp>
0055 
0056 #endif // BOOST_TEST_UTILS_RUNTIME_FINALIZE_HPP