summaryrefslogtreecommitdiff
path: root/libs/geometry/test/geometry_test_common.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/geometry/test/geometry_test_common.hpp')
-rw-r--r--libs/geometry/test/geometry_test_common.hpp34
1 files changed, 30 insertions, 4 deletions
diff --git a/libs/geometry/test/geometry_test_common.hpp b/libs/geometry/test/geometry_test_common.hpp
index 7bff83799..f4fbd65b7 100644
--- a/libs/geometry/test/geometry_test_common.hpp
+++ b/libs/geometry/test/geometry_test_common.hpp
@@ -1,8 +1,8 @@
// Boost.Geometry (aka GGL, Generic Geometry Library)
-// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
-// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
-// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
+// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
+// Copyright (c) 2008-2015 Bruno Lalande, Paris, France.
+// Copyright (c) 2009-2015 Mateusz Loskot, London, UK.
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
@@ -15,6 +15,27 @@
#ifndef GEOMETRY_TEST_GEOMETRY_TEST_COMMON_HPP
#define GEOMETRY_TEST_GEOMETRY_TEST_COMMON_HPP
+// Determine debug/release mode
+// (it would be convenient if Boost.Config or Boost.Test would define this)
+// Note that they might be combined (e.g. for optimize+no inline)
+#if defined (__clang__) || defined(__gcc__)
+#if defined(__OPTIMIZE__)
+ #define BOOST_GEOMETRY_COMPILER_MODE_RELEASE
+#endif
+#if defined(__NO_INLINE__)
+#define BOOST_GEOMETRY_COMPILER_MODE_DEBUG
+#endif
+#endif
+
+#if defined(_MSC_VER)
+#if defined(_DEBUG)
+#define BOOST_GEOMETRY_COMPILER_MODE_DEBUG
+#else
+#define BOOST_GEOMETRY_COMPILER_MODE_RELEASE
+#endif
+#endif
+
+
#if defined(_MSC_VER)
// We deliberately mix float/double's so turn off warnings
#pragma warning( disable : 4244 )
@@ -41,16 +62,21 @@
#if ! defined(BOOST_GEOMETRY_NO_BOOST_TEST)
// Until Boost.Test fixes it, silence warning issued by clang:
-// warning: unused variable 'check_is_close' [-Wunused-variable]
#ifdef __clang__
# pragma clang diagnostic push
+// warning: unused variable 'check_is_close' [-Wunused-variable]
# pragma clang diagnostic ignored "-Wunused-variable"
+// warnings when -Wconversion is set
+# pragma clang diagnostic ignored "-Wsign-conversion"
+# pragma clang diagnostic ignored "-Wshorten-64-to-32"
#endif
# include <boost/test/floating_point_comparison.hpp>
+#ifndef BOOST_TEST_MODULE
# include <boost/test/included/test_exec_monitor.hpp>
//# include <boost/test/included/prg_exec_monitor.hpp>
# include <boost/test/impl/execution_monitor.ipp>
+#endif
#ifdef __clang__
# pragma clang diagnostic pop