1 // (c) Copyright Raffi Enficiaud 2017.
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.
9 //! An observer for monitoring the success/failure of the other observers
10 // ***************************************************************************
12 #ifndef BOOST_TEST_FRAMEWORK_INIT_OBSERVER_IPP_021105GER
13 #define BOOST_TEST_FRAMEWORK_INIT_OBSERVER_IPP_021105GER
16 #include <boost/test/test_framework_init_observer.hpp>
17 #include <boost/test/framework.hpp>
18 #include <boost/test/detail/suppress_warnings.hpp>
20 //____________________________________________________________________________//
26 //____________________________________________________________________________//
28 // ************************************************************************** //
29 // ************** framework_init_observer_t ************** //
30 // ************************************************************************** //
34 struct test_init_observer_check {
44 test_init_observer_check& s_tioc_impl() { static test_init_observer_check the_inst; return the_inst; }
49 framework_init_observer_t::clear()
51 if(!framework::test_in_progress())
52 s_tioc_impl().clear();
55 //____________________________________________________________________________//
58 framework_init_observer_t::test_start( counter_t )
63 //____________________________________________________________________________//
66 framework_init_observer_t::assertion_result( unit_test::assertion_result ar )
68 test_init_observer_check& tr = s_tioc_impl();
70 case AR_TRIGGERED: break;
71 case AR_PASSED: break;
72 case AR_FAILED: tr.has_failure = true; break;
78 //____________________________________________________________________________//
81 framework_init_observer_t::exception_caught( execution_exception const& )
83 test_init_observer_check& tr = s_tioc_impl();
84 tr.has_failure = true;
88 framework_init_observer_t::test_aborted()
90 s_tioc_impl().has_failure = true;
94 //____________________________________________________________________________//
97 framework_init_observer_t::has_failed() const
99 return s_tioc_impl().has_failure;
102 //____________________________________________________________________________//
104 } // namespace unit_test
107 #include <boost/test/detail/enable_warnings.hpp>
109 #endif // BOOST_TEST_FRAMEWORK_INIT_OBSERVER_IPP_021105GER