]>
Commit | Line | Data |
---|---|---|
b32b8144 FG |
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/utils/trivial_singleton.hpp> | |
22 | ||
23 | #include <boost/test/detail/suppress_warnings.hpp> | |
24 | ||
25 | //____________________________________________________________________________// | |
26 | ||
27 | namespace boost { | |
28 | namespace unit_test { | |
29 | ||
30 | // ************************************************************************** // | |
31 | /// @brief Monitors the init of the framework | |
32 | /// | |
33 | /// This class collects the state of the init/termination of the unit test framework. | |
34 | /// | |
35 | /// @see boost::unit_test::test_observer | |
36 | class BOOST_TEST_DECL framework_init_observer_t : public test_observer, public singleton<framework_init_observer_t> { | |
37 | public: | |
38 | ||
39 | virtual void test_start( counter_t ); | |
40 | ||
41 | virtual void assertion_result( unit_test::assertion_result ); | |
42 | virtual void exception_caught( execution_exception const& ); | |
43 | virtual void test_aborted(); | |
44 | ||
45 | virtual int priority() { return 0; } | |
46 | ||
47 | void clear(); | |
48 | ||
49 | /// Indicates if a failure has been recorded so far | |
50 | bool has_failed( ) const; | |
51 | ||
52 | private: | |
53 | BOOST_TEST_SINGLETON_CONS( framework_init_observer_t ) | |
54 | }; | |
55 | ||
56 | BOOST_TEST_SINGLETON_INST( framework_init_observer ) | |
57 | ||
58 | } // namespace unit_test | |
59 | } // namespace boost | |
60 | ||
61 | #include <boost/test/detail/enable_warnings.hpp> | |
62 | ||
63 | #endif // BOOST_TEST_FRAMEWORK_INIT_OBSERVER_HPP_071894GER |