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 |
9 | /// @brief defines simple text based progress monitor |
10 | // *************************************************************************** |
11 | |
12 | #ifndef BOOST_TEST_PROGRESS_MONITOR_HPP_020105GER |
13 | #define BOOST_TEST_PROGRESS_MONITOR_HPP_020105GER |
14 | |
15 | // Boost.Test |
16 | #include <boost/test/tree/observer.hpp> |
17 | #include <boost/test/utils/trivial_singleton.hpp> |
18 | |
19 | // STL |
20 | #include <iosfwd> // for std::ostream& |
21 | |
22 | #include <boost/test/detail/suppress_warnings.hpp> |
23 | |
24 | //____________________________________________________________________________// |
25 | |
26 | namespace boost { |
27 | namespace unit_test { |
28 | |
29 | // ************************************************************************** // |
30 | // ************** progress_monitor ************** // |
31 | // ************************************************************************** // |
32 | |
33 | /// This class implements test observer interface and updates test progress as test units finish or get aborted |
34 | class BOOST_TEST_DECL progress_monitor_t : public test_observer, public singleton<progress_monitor_t> { |
35 | public: |
36 | /// @name Test observer interface |
37 | /// @{ |
38 | virtual void test_start( counter_t test_cases_amount ); |
39 | virtual void test_aborted(); |
40 | |
41 | virtual void test_unit_finish( test_unit const&, unsigned long ); |
42 | virtual void test_unit_skipped( test_unit const&, const_string ); |
43 | |
44 | virtual int priority() { return 3; } |
45 | /// @} |
46 | |
47 | /// @name Configuration |
48 | /// @{ |
49 | void set_stream( std::ostream& ); |
50 | /// @} |
51 | |
52 | private: |
53 | BOOST_TEST_SINGLETON_CONS( progress_monitor_t ) |
54 | }; // progress_monitor_t |
55 | |
56 | BOOST_TEST_SINGLETON_INST( progress_monitor ) |
57 | |
58 | } // namespace unit_test |
59 | } // namespace boost |
60 | |
61 | //____________________________________________________________________________// |
62 | |
63 | #include <boost/test/detail/enable_warnings.hpp> |
64 | |
65 | #endif // BOOST_TEST_PROGRESS_MONITOR_HPP_020105GER |
66 | |
67 |