Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions include/boost/test/impl/decorator.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
// Boost.Test
#include <boost/test/tree/decorator.hpp>
#include <boost/test/tree/test_unit.hpp>
#include <boost/test/impl/trivial_singleton.ipp>

#include <boost/test/framework.hpp>
#if BOOST_TEST_SUPPORT_TOKEN_ITERATOR
Expand Down
1 change: 1 addition & 0 deletions include/boost/test/impl/progress_monitor.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

// Boost.Test
#include <boost/test/progress_monitor.hpp>
#include <boost/test/impl/trivial_singleton.ipp>
#include <boost/test/unit_test_parameters.hpp>

#include <boost/test/utils/setcolor.hpp>
Expand Down
1 change: 1 addition & 0 deletions include/boost/test/impl/results_collector.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
// Boost.Test
#include <boost/test/unit_test_log.hpp>
#include <boost/test/results_collector.hpp>
#include <boost/test/impl/trivial_singleton.ipp>
#include <boost/test/framework.hpp>

#include <boost/test/tree/test_unit.hpp>
Expand Down
1 change: 1 addition & 0 deletions include/boost/test/impl/test_framework_init_observer.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

// Boost.Test
#include <boost/test/test_framework_init_observer.hpp>
#include <boost/test/impl/trivial_singleton.ipp>
#include <boost/test/framework.hpp>
#include <boost/test/detail/suppress_warnings.hpp>

Expand Down
26 changes: 26 additions & 0 deletions include/boost/test/impl/trivial_singleton.ipp
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// (C) Copyright Gennadiy Rozental 2001.
// (C) Antony Polukhin 2018.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

// This header must be included ONLY in the *.ipp files to avoid issues with visibility.
// See the long discussion starting
// from https://github.com/boostorg/boost/pull/190#issuecomment-422197454

#ifndef BOOST_TEST_IMPL_TRIVIAL_SIGNLETON_IPP
#define BOOST_TEST_IMPL_TRIVIAL_SIGNLETON_IPP

#include <boost/test/utils/trivial_singleton.hpp>

namespace boost { namespace unit_test {

template<typename Derived>
Derived& singleton<Derived>::instance() {
static Derived the_inst;
return the_inst;
}

}}

#endif // BOOST_TEST_IMPL_TRIVIAL_SIGNLETON_IPP
1 change: 1 addition & 0 deletions include/boost/test/impl/unit_test_log.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <boost/test/unit_test_log.hpp>
#include <boost/test/unit_test_log_formatter.hpp>
#include <boost/test/execution_monitor.hpp>
#include <boost/test/impl/trivial_singleton.ipp>
#include <boost/test/framework.hpp>
#include <boost/test/unit_test_parameters.hpp>

Expand Down
1 change: 1 addition & 0 deletions include/boost/test/impl/unit_test_monitor.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

// Boost.Test
#include <boost/test/unit_test_monitor.hpp>
#include <boost/test/impl/trivial_singleton.ipp>
#include <boost/test/framework.hpp>
#include <boost/test/tree/test_unit.hpp>
#include <boost/test/unit_test_parameters.hpp>
Expand Down
8 changes: 4 additions & 4 deletions include/boost/test/utils/runtime/errors.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ namespace runtime {
// ************** runtime::param_error ************** //
// ************************************************************************** //

class param_error : public std::exception {
class BOOST_SYMBOL_VISIBLE param_error : public std::exception {
public:
~param_error() BOOST_NOEXCEPT_OR_NOTHROW {}

Expand All @@ -55,7 +55,7 @@ class param_error : public std::exception {

//____________________________________________________________________________//

class init_error : public param_error {
class BOOST_SYMBOL_VISIBLE init_error : public param_error {
protected:
explicit init_error( cstring param_name ) : param_error( param_name ) {}
~init_error() BOOST_NOEXCEPT_OR_NOTHROW {}
Expand All @@ -70,7 +70,7 @@ class input_error : public param_error {
//____________________________________________________________________________//

template<typename Derived, typename Base>
class specific_param_error : public Base {
class BOOST_SYMBOL_VISIBLE specific_param_error : public Base {
protected:
explicit specific_param_error( cstring param_name ) : Base( param_name ) {}
~specific_param_error() BOOST_NOEXCEPT_OR_NOTHROW {}
Expand Down Expand Up @@ -155,7 +155,7 @@ SPECIFIC_EX_TYPE( missing_req_arg, input_error );

#undef SPECIFIC_EX_TYPE

class ambiguous_param : public specific_param_error<ambiguous_param, input_error> {
class BOOST_SYMBOL_VISIBLE ambiguous_param : public specific_param_error<ambiguous_param, input_error> {
public:
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
explicit ambiguous_param( std::vector<cstring>&& amb_candidates )
Expand Down
2 changes: 1 addition & 1 deletion include/boost/test/utils/trivial_singleton.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ namespace unit_test {
template<typename Derived>
class singleton {
public:
static Derived& instance() { static Derived the_inst; return the_inst; }
BOOST_TEST_DECL static Derived& instance();

BOOST_DELETED_FUNCTION(singleton(singleton const&))
BOOST_DELETED_FUNCTION(singleton& operator=(singleton const&))
Expand Down