Back to home page

EIC code displayed by LXR

 
 

    


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

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: 74248 $
0011 //
0012 //  Description : test tools context interfaces
0013 // ***************************************************************************
0014 
0015 #ifndef BOOST_TEST_TOOLS_CONTEXT_HPP_111712GER
0016 #define BOOST_TEST_TOOLS_CONTEXT_HPP_111712GER
0017 
0018 // Boost.Test
0019 #include <boost/test/utils/lazy_ostream.hpp>
0020 #include <boost/test/detail/pp_variadic.hpp>
0021 
0022 #include <boost/preprocessor/repetition/enum_params.hpp>
0023 #include <boost/preprocessor/repetition/enum_binary_params.hpp>
0024 #include <boost/preprocessor/repetition/repeat_from_to.hpp>
0025 
0026 #include <boost/preprocessor/variadic/to_seq.hpp>
0027 #include <boost/preprocessor/variadic/size.hpp>
0028 #include <boost/preprocessor/cat.hpp>
0029 #include <boost/preprocessor/seq/for_each_i.hpp>
0030 #include <boost/preprocessor/seq/for_each.hpp>
0031 #include <boost/preprocessor/seq/enum.hpp>
0032 #include <boost/preprocessor/control/iif.hpp>
0033 #include <boost/preprocessor/comparison/equal.hpp>
0034 
0035 #include <boost/test/detail/suppress_warnings.hpp>
0036 
0037 //____________________________________________________________________________//
0038 
0039 namespace boost {
0040 namespace test_tools {
0041 namespace tt_detail {
0042 
0043 // ************************************************************************** //
0044 // **************                 context_frame                ************** //
0045 // ************************************************************************** //
0046 
0047 struct BOOST_TEST_DECL context_frame {
0048     explicit    context_frame( ::boost::unit_test::lazy_ostream const& context_descr );
0049     ~context_frame();
0050 
0051     operator    bool();
0052 
0053 private:
0054     // Data members
0055     int         m_frame_id;
0056 };
0057 
0058 //____________________________________________________________________________//
0059 
0060 #define BOOST_TEST_INFO( context_descr )                                                        \
0061     ::boost::unit_test::framework::add_context( BOOST_TEST_LAZY_MSG( context_descr ) , false )  \
0062 /**/
0063 
0064 #define BOOST_TEST_INFO_SCOPE( context_descr )                                                 \
0065     ::boost::test_tools::tt_detail::context_frame BOOST_JOIN( context_frame_, __LINE__ ) =      \
0066        ::boost::test_tools::tt_detail::context_frame(BOOST_TEST_LAZY_MSG( context_descr ) )     \
0067 /**/
0068 
0069 //____________________________________________________________________________//
0070 
0071 
0072 #define BOOST_CONTEXT_PARAM(r, ctx, i, context_descr)  \
0073   if( ::boost::test_tools::tt_detail::context_frame BOOST_PP_CAT(ctx, i) =                       \
0074         ::boost::test_tools::tt_detail::context_frame(BOOST_TEST_LAZY_MSG( context_descr ) ) )   \
0075 /**/
0076 
0077 #define BOOST_CONTEXT_PARAMS( params )                                                           \
0078         BOOST_PP_SEQ_FOR_EACH_I(BOOST_CONTEXT_PARAM,                                             \
0079                                 BOOST_JOIN( context_frame_, __LINE__ ),                          \
0080                                 params)                                                          \
0081 /**/
0082 
0083 #define BOOST_TEST_CONTEXT( ... )                                                                \
0084     BOOST_CONTEXT_PARAMS(  BOOST_PP_VARIADIC_TO_SEQ(__VA_ARGS__) )                               \
0085 /**/
0086 
0087 
0088 //____________________________________________________________________________//
0089 
0090 } // namespace tt_detail
0091 } // namespace test_tools
0092 } // namespace boost
0093 
0094 #include <boost/test/detail/enable_warnings.hpp>
0095 
0096 #endif // BOOST_TEST_TOOLS_CONTEXT_HPP_111712GER