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 : $RCSfile$
9//
10// Version : $Revision: 74640 $
11//
12// Description : defines global_fixture
13// ***************************************************************************
14
15#ifndef BOOST_TEST_TREE_GLOBAL_FIXTURE_HPP_091911GER
16#define BOOST_TEST_TREE_GLOBAL_FIXTURE_HPP_091911GER
17
18// Boost.Test
19#include <boost/test/detail/config.hpp>
20#include <boost/test/detail/global_typedef.hpp>
21
22#include <boost/test/tree/observer.hpp>
23
24#include <boost/test/detail/suppress_warnings.hpp>
25
26
27//____________________________________________________________________________//
28
29namespace boost {
30namespace unit_test {
31
32// ************************************************************************** //
33// ************** global_fixture ************** //
34// ************************************************************************** //
35
36class BOOST_TEST_DECL global_fixture : public test_observer {
37public:
38 // Constructor
39 global_fixture();
40};
41
42//____________________________________________________________________________//
43
44namespace ut_detail {
45
46template<typename F>
47struct global_fixture_impl : public global_fixture {
48 // Constructor
49 global_fixture_impl() : m_fixture( 0 ) {}
50
51 // test observer interface
52 virtual void test_start( counter_t ) { m_fixture = new F; }
53 virtual void test_finish() { delete m_fixture; m_fixture = 0; }
54 virtual void test_aborted() { delete m_fixture; m_fixture = 0; }
55
56private:
57 // Data members
58 F* m_fixture;
59};
60
61} // namespace ut_detail
62} // namespace unit_test
63} // namespace boost
64
65#include <boost/test/detail/enable_warnings.hpp>
66
67#endif // BOOST_TEST_TREE_GLOBAL_FIXTURE_HPP_091911GER
68
69

source code of boost/boost/test/tree/global_fixture.hpp