File indexing completed on 2025-01-18 09:52:40
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #ifndef BOOST_TEST_TOOLS_CONTEXT_HPP_111712GER
0016 #define BOOST_TEST_TOOLS_CONTEXT_HPP_111712GER
0017
0018
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
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
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 }
0091 }
0092 }
0093
0094 #include <boost/test/detail/enable_warnings.hpp>
0095
0096 #endif