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)
5
6// See http://www.boost.org/libs/test for the library home page.
7//
8// File : $RCSfile$
9//
10// Version : $Revision: 74248 $
11//
12// Description : test tools context interfaces
13// ***************************************************************************
14
15#ifndef BOOST_TEST_TOOLS_CONTEXT_HPP_111712GER
16#define BOOST_TEST_TOOLS_CONTEXT_HPP_111712GER
17
18// Boost.Test
19#include <boost/test/utils/lazy_ostream.hpp>
20
21#include <boost/test/detail/suppress_warnings.hpp>
22
23//____________________________________________________________________________//
24
25namespace boost {
26namespace test_tools {
27namespace tt_detail {
28
29// ************************************************************************** //
30// ************** context_frame ************** //
31// ************************************************************************** //
32
33struct BOOST_TEST_DECL context_frame {
34 explicit context_frame( ::boost::unit_test::lazy_ostream const& context_descr );
35 ~context_frame();
36
37 operator bool();
38
39private:
40 // Data members
41 int m_frame_id;
42};
43
44//____________________________________________________________________________//
45
46#define BOOST_TEST_INFO( context_descr ) \
47 ::boost::unit_test::framework::add_context( BOOST_TEST_LAZY_MSG( context_descr ) , false ) \
48/**/
49
50//____________________________________________________________________________//
51
52#define BOOST_TEST_CONTEXT( context_descr ) \
53 if( ::boost::test_tools::tt_detail::context_frame BOOST_JOIN( context_frame_, __LINE__ ) = \
54 ::boost::test_tools::tt_detail::context_frame( BOOST_TEST_LAZY_MSG( context_descr ) ) ) \
55/**/
56
57//____________________________________________________________________________//
58
59} // namespace tt_detail
60} // namespace test_tools
61} // namespace boost
62
63#include <boost/test/detail/enable_warnings.hpp>
64
65#endif // BOOST_TEST_TOOLS_CONTEXT_HPP_111712GER
66

source code of boost/boost/test/tools/context.hpp