• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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)
5 
6 // See http://www.boost.org/libs/test for the library home page.
7 //
8 /// @file
9 /// @brief Defines an observer that monitors the init of the unit test framework
10 // ***************************************************************************
11 
12 #ifndef BOOST_TEST_FRAMEWORK_INIT_OBSERVER_HPP_071894GER
13 #define BOOST_TEST_FRAMEWORK_INIT_OBSERVER_HPP_071894GER
14 
15 // Boost.Test
16 #include <boost/test/tree/observer.hpp>
17 
18 #include <boost/test/detail/global_typedef.hpp>
19 #include <boost/test/detail/fwd_decl.hpp>
20 
21 #include <boost/test/detail/suppress_warnings.hpp>
22 
23 //____________________________________________________________________________//
24 
25 namespace boost {
26 namespace unit_test {
27 
28 // ************************************************************************** //
29 /// @brief Monitors the init of the framework
30 ///
31 /// This class collects the state of the init/termination of the unit test framework.
32 ///
33 /// @see boost::unit_test::test_observer
34 class BOOST_TEST_DECL framework_init_observer_t : public test_observer {
35 public:
36 
37     void        test_start( counter_t, test_unit_id ) BOOST_OVERRIDE;
38 
39     void        assertion_result( unit_test::assertion_result ) BOOST_OVERRIDE;
40     void        exception_caught( execution_exception const& ) BOOST_OVERRIDE;
41     void        test_aborted() BOOST_OVERRIDE;
42 
priority()43     int         priority() BOOST_OVERRIDE { return 0; }
44 
45     void                clear();
46 
47     /// Indicates if a failure has been recorded so far
48     bool                has_failed( ) const;
49 
50 private:
51     bool m_has_failure;
52 };
53 
54 } // namespace unit_test
55 } // namespace boost
56 
57 #include <boost/test/detail/enable_warnings.hpp>
58 
59 #endif // BOOST_TEST_FRAMEWORK_INIT_OBSERVER_HPP_071894GER
60