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 //____________________________________________________________________________//
52 BOOST_TEST_SINGLETON_CONS_IMPL(framework_init_observer_t)
54 //____________________________________________________________________________//
57 framework_init_observer_t::clear()
59 if(!framework::test_in_progress())
60 s_tioc_impl().clear();
63 //____________________________________________________________________________//
66 framework_init_observer_t::test_start( counter_t )
71 //____________________________________________________________________________//
74 framework_init_observer_t::assertion_result( unit_test::assertion_result ar )
76 test_init_observer_check& tr = s_tioc_impl();
78 case AR_TRIGGERED: break;
79 case AR_PASSED: break;
80 case AR_FAILED: tr.has_failure = true; break;
86 //____________________________________________________________________________//
89 framework_init_observer_t::exception_caught( execution_exception const& )
91 test_init_observer_check& tr = s_tioc_impl();
92 tr.has_failure = true;
96 framework_init_observer_t::test_aborted()
98 s_tioc_impl().has_failure = true;
102 //____________________________________________________________________________//
105 framework_init_observer_t::has_failed() const
107 return s_tioc_impl().has_failure;
110 //____________________________________________________________________________//
112 } // namespace unit_test
115 #include <boost/test/detail/enable_warnings.hpp>
117 #endif // BOOST_TEST_FRAMEWORK_INIT_OBSERVER_IPP_021105GER