updated boost on windows
This commit is contained in:
@@ -78,10 +78,27 @@ class type_info;
|
||||
|
||||
//____________________________________________________________________________//
|
||||
|
||||
// Sun compiler does not support visibility on enums
|
||||
#if defined(__SUNPRO_CC)
|
||||
#define BOOST_TEST_ENUM_SYMBOL_VISIBLE
|
||||
#else
|
||||
#define BOOST_TEST_ENUM_SYMBOL_VISIBLE BOOST_SYMBOL_VISIBLE
|
||||
#endif
|
||||
|
||||
//____________________________________________________________________________//
|
||||
|
||||
#if defined(BOOST_ALL_DYN_LINK) && !defined(BOOST_TEST_DYN_LINK)
|
||||
# define BOOST_TEST_DYN_LINK
|
||||
#endif
|
||||
|
||||
// in case any of the define from cmake/b2 is set
|
||||
#if !defined(BOOST_TEST_DYN_LINK) \
|
||||
&& (defined(BOOST_UNIT_TEST_FRAMEWORK_DYN_LINK) \
|
||||
|| defined(BOOST_TEST_EXEC_MONITOR_DYN_LINK) \
|
||||
|| defined(BOOST_PRG_EXEC_MONITOR_DYN_LINK) )
|
||||
# define BOOST_TEST_DYN_LINK
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_TEST_INCLUDED)
|
||||
# undef BOOST_TEST_DYN_LINK
|
||||
#endif
|
||||
@@ -90,12 +107,12 @@ class type_info;
|
||||
# define BOOST_TEST_ALTERNATIVE_INIT_API
|
||||
|
||||
# ifdef BOOST_TEST_SOURCE
|
||||
# define BOOST_TEST_DECL BOOST_SYMBOL_EXPORT
|
||||
# define BOOST_TEST_DECL BOOST_SYMBOL_EXPORT BOOST_SYMBOL_VISIBLE
|
||||
# else
|
||||
# define BOOST_TEST_DECL BOOST_SYMBOL_IMPORT
|
||||
# define BOOST_TEST_DECL BOOST_SYMBOL_IMPORT BOOST_SYMBOL_VISIBLE
|
||||
# endif // BOOST_TEST_SOURCE
|
||||
#else
|
||||
# define BOOST_TEST_DECL
|
||||
# define BOOST_TEST_DECL BOOST_SYMBOL_VISIBLE
|
||||
#endif
|
||||
|
||||
#if !defined(BOOST_TEST_MAIN) && defined(BOOST_AUTO_TEST_MAIN)
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
# pragma warning(pop)
|
||||
#endif
|
||||
|
||||
#if BOOST_CLANG
|
||||
#if defined(BOOST_CLANG) && (BOOST_CLANG == 1)
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
|
||||
|
||||
@@ -26,6 +26,8 @@ class master_test_suite_t;
|
||||
|
||||
class test_tree_visitor;
|
||||
class test_observer;
|
||||
class test_unit_fixture;
|
||||
class global_fixture;
|
||||
|
||||
// singletons
|
||||
class unit_test_monitor_t;
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
#define BOOST_TEST_GLOBAL_TYPEDEF_HPP_021005GER
|
||||
|
||||
#include <boost/test/utils/basic_cstring/basic_cstring.hpp>
|
||||
#include <boost/test/detail/workaround.hpp>
|
||||
|
||||
#define BOOST_TEST_L( s ) ::boost::unit_test::const_string( s, sizeof( s ) - 1 )
|
||||
#define BOOST_TEST_STRINGIZE( s ) BOOST_TEST_L( BOOST_STRINGIZE( s ) )
|
||||
@@ -71,6 +70,21 @@ test_id_2_unit_type( test_unit_id id )
|
||||
return (id & 0xFFFF0000) != 0 ? TUT_CASE : TUT_SUITE;
|
||||
}
|
||||
|
||||
//! Helper class for restoring the current test unit ID in a RAII manner
|
||||
struct test_unit_id_restore {
|
||||
test_unit_id_restore(test_unit_id& to_restore_, test_unit_id new_value)
|
||||
: to_restore(to_restore_)
|
||||
, bkup(to_restore_) {
|
||||
to_restore = new_value;
|
||||
}
|
||||
~test_unit_id_restore() {
|
||||
to_restore = bkup;
|
||||
}
|
||||
private:
|
||||
test_unit_id& to_restore;
|
||||
test_unit_id bkup;
|
||||
};
|
||||
|
||||
//____________________________________________________________________________//
|
||||
|
||||
} // namespace ut_detail
|
||||
@@ -86,6 +100,45 @@ T static_constant<T>::value;
|
||||
|
||||
//____________________________________________________________________________//
|
||||
|
||||
// helper defines for singletons.
|
||||
// BOOST_TEST_SINGLETON_CONS should appear in the class body,
|
||||
// BOOST_TEST_SINGLETON_CONS_IMPL should be in only one translation unit. The
|
||||
// global instance should be declared by BOOST_TEST_SINGLETON_INST.
|
||||
|
||||
#define BOOST_TEST_SINGLETON_CONS_NO_CTOR( type ) \
|
||||
public: \
|
||||
static type& instance(); \
|
||||
private: \
|
||||
BOOST_DELETED_FUNCTION(type(type const&)) \
|
||||
BOOST_DELETED_FUNCTION(type& operator=(type const&)) \
|
||||
BOOST_DEFAULTED_FUNCTION(~type(), {}) \
|
||||
/**/
|
||||
|
||||
#define BOOST_TEST_SINGLETON_CONS( type ) \
|
||||
BOOST_TEST_SINGLETON_CONS_NO_CTOR(type) \
|
||||
private: \
|
||||
BOOST_DEFAULTED_FUNCTION(type(), {}) \
|
||||
/**/
|
||||
|
||||
#define BOOST_TEST_SINGLETON_CONS_IMPL( type ) \
|
||||
type& type::instance() { \
|
||||
static type the_inst; return the_inst; \
|
||||
} \
|
||||
/**/
|
||||
|
||||
//____________________________________________________________________________//
|
||||
|
||||
#if defined(__APPLE_CC__) && defined(__GNUC__) && __GNUC__ < 4
|
||||
#define BOOST_TEST_SINGLETON_INST( inst ) \
|
||||
static BOOST_JOIN( inst, _t)& inst BOOST_ATTRIBUTE_UNUSED = BOOST_JOIN (inst, _t)::instance();
|
||||
|
||||
#else
|
||||
|
||||
#define BOOST_TEST_SINGLETON_INST( inst ) \
|
||||
namespace { BOOST_JOIN( inst, _t)& inst BOOST_ATTRIBUTE_UNUSED = BOOST_JOIN( inst, _t)::instance(); }
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace unit_test
|
||||
} // namespace boost
|
||||
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
#ifndef BOOST_TEST_LOG_LEVEL_HPP_011605GER
|
||||
#define BOOST_TEST_LOG_LEVEL_HPP_011605GER
|
||||
|
||||
#include <boost/test/detail/config.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace unit_test {
|
||||
|
||||
@@ -20,7 +22,7 @@ namespace unit_test {
|
||||
// ************************************************************************** //
|
||||
|
||||
// each log level includes all subsequent higher loging levels
|
||||
enum log_level {
|
||||
enum BOOST_TEST_ENUM_SYMBOL_VISIBLE log_level {
|
||||
invalid_log_level = -1,
|
||||
log_successful_tests = 0,
|
||||
log_test_units = 1,
|
||||
|
||||
@@ -26,13 +26,15 @@
|
||||
# pragma warning(disable: 4511) // 'class' : copy constructor could not be generated
|
||||
#endif
|
||||
|
||||
#if BOOST_CLANG
|
||||
#if defined(BOOST_CLANG) && (BOOST_CLANG == 1)
|
||||
# pragma clang diagnostic push
|
||||
# pragma clang diagnostic ignored "-Wvariadic-macros"
|
||||
# pragma clang diagnostic ignored "-Wmissing-declarations"
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_GCC) && (BOOST_GCC >= 4 * 10000 + 6 * 100)
|
||||
# pragma GCC diagnostic push
|
||||
# pragma GCC diagnostic ignored "-Wvariadic-macros"
|
||||
# pragma GCC diagnostic ignored "-Wmissing-declarations"
|
||||
#endif
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace ut_detail {
|
||||
|
||||
template<typename E>
|
||||
BOOST_NORETURN inline void
|
||||
throw_exception(E const& e) { abort(); }
|
||||
throw_exception(E const& /*e*/) { abort(); }
|
||||
|
||||
#define BOOST_TEST_I_TRY
|
||||
#define BOOST_TEST_I_CATCH( T, var ) for(T const& var = *(T*)0; false;)
|
||||
|
||||
@@ -1,56 +0,0 @@
|
||||
// (C) Copyright Gennadiy Rozental 2001.
|
||||
// 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)
|
||||
|
||||
// See http://www.boost.org/libs/test for the library home page.
|
||||
//
|
||||
//!@file
|
||||
//!@brief contains mics. workarounds
|
||||
// ***************************************************************************
|
||||
|
||||
#ifndef BOOST_TEST_WORKAROUND_HPP_021005GER
|
||||
#define BOOST_TEST_WORKAROUND_HPP_021005GER
|
||||
|
||||
// Boost
|
||||
#include <boost/config.hpp> // compilers workarounds and std::ptrdiff_t
|
||||
|
||||
// STL
|
||||
#include <iterator> // for std::distance
|
||||
|
||||
#include <boost/test/detail/suppress_warnings.hpp>
|
||||
|
||||
//____________________________________________________________________________//
|
||||
|
||||
namespace boost {
|
||||
namespace unit_test {
|
||||
namespace ut_detail {
|
||||
|
||||
#ifdef BOOST_NO_STD_DISTANCE
|
||||
template <class T>
|
||||
std::ptrdiff_t distance( T const& x_, T const& y_ )
|
||||
{
|
||||
std::ptrdiff_t res = 0;
|
||||
|
||||
std::distance( x_, y_, res );
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
//____________________________________________________________________________//
|
||||
|
||||
#else
|
||||
using std::distance;
|
||||
#endif
|
||||
|
||||
template <class T> inline void ignore_unused_variable_warning(const T&) {}
|
||||
|
||||
} // namespace ut_detail
|
||||
} // namespace unit_test
|
||||
} // namespace boost
|
||||
|
||||
//____________________________________________________________________________//
|
||||
|
||||
#include <boost/test/detail/enable_warnings.hpp>
|
||||
|
||||
#endif // BOOST_TEST_WORKAROUND_HPP_021005GER
|
||||
Reference in New Issue
Block a user