fix doc example typo
[boost.git] / boost / test / unit_test_monitor.hpp
blob9ac1e139f34cb9f6268bcfb0e4672c2d3ba9c6d7
1 // (C) Copyright Gennadiy Rozental 2001-2008.
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.
7 //
8 // File : $RCSfile$
9 //
10 // Version : $Revision$
12 // Description : defines specific version of execution monitor used to managed
13 // run unit of test cases. Translates execution exception into error level
14 // ***************************************************************************
16 #ifndef BOOST_TEST_UNIT_TEST_MONITOR_HPP_020905GER
17 #define BOOST_TEST_UNIT_TEST_MONITOR_HPP_020905GER
19 // Boost.Test
20 #include <boost/test/execution_monitor.hpp>
21 #include <boost/test/detail/fwd_decl.hpp>
22 #include <boost/test/utils/trivial_singleton.hpp>
23 #include <boost/test/utils/callback.hpp>
25 #include <boost/test/detail/suppress_warnings.hpp>
27 //____________________________________________________________________________//
29 namespace boost {
31 namespace unit_test {
33 // ************************************************************************** //
34 // ************** unit_test_monitor ************** //
35 // ************************************************************************** //
37 class BOOST_TEST_DECL unit_test_monitor_t : public singleton<unit_test_monitor_t>, public execution_monitor {
38 public:
39 enum error_level {
40 test_fail = 1,
41 test_ok = 0,
42 constructor_error = -1,
43 unexpected_exception = -2,
44 os_exception = -3,
45 os_timeout = -4,
46 fatal_error = -5, // includes both system and user
47 destructor_error = -6
50 static bool is_critical_error( error_level e ) { return e <= fatal_error; }
52 // monitor method
53 error_level execute_and_translate( test_case const& );
55 private:
56 BOOST_TEST_SINGLETON_CONS( unit_test_monitor_t );
59 BOOST_TEST_SINGLETON_INST( unit_test_monitor )
61 } // namespace unit_test
63 } // namespace boost
65 //____________________________________________________________________________//
67 #include <boost/test/detail/enable_warnings.hpp>
69 #endif // BOOST_TEST_UNIT_TEST_MONITOR_HPP_020905GER