|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r81440 - in trunk/libs/multiprecision: config test
From: john_at_[hidden]
Date: 2012-11-20 13:50:09
Author: johnmaddock
Date: 2012-11-20 13:50:08 EST (Tue, 20 Nov 2012)
New Revision: 81440
URL: http://svn.boost.org/trac/boost/changeset/81440
Log:
Enhance config tests.
Split cpp_int tests into smaller chunks.
Text files modified:
trunk/libs/multiprecision/config/Jamfile.v2 | 26 ++++++++++
trunk/libs/multiprecision/config/has_gmp.cpp | 8 ++
trunk/libs/multiprecision/config/has_mpfr.cpp | 14 +++++
trunk/libs/multiprecision/test/Jamfile.v2 | 96 +++++++++++++++++++++++++++++++++++++--
trunk/libs/multiprecision/test/test_arithmetic.cpp | 87 ++++++++++++++++++-----------------
5 files changed, 180 insertions(+), 51 deletions(-)
Modified: trunk/libs/multiprecision/config/Jamfile.v2
==============================================================================
--- trunk/libs/multiprecision/config/Jamfile.v2 (original)
+++ trunk/libs/multiprecision/config/Jamfile.v2 2012-11-20 13:50:08 EST (Tue, 20 Nov 2012)
@@ -10,9 +10,31 @@
local mpfr_path = [ modules.peek : MPFR_PATH ] ;
local tommath_path = [ modules.peek : TOMMATH_PATH ] ;
-obj has_gmp : has_gmp.cpp :
+project : requirements
+ <include>$(gmp_path)
+ <include>$(gmp_path)/mpfr
+ <include>$(gmp_path)/gmpfrxx
+ <include>$(mpfr_path)
+ <include>$(tommath_path)
+ <include>../../..
+ <search>$(gmp_path)
+ <search>$(mpfr_path)
+ <search>$(mpfr_path)/build.vc10/lib/Win32/Debug
+ <search>$(tommath_path)
+ # We set these to make it easier to set up and test GMP and MPFR under Win32:
+ <toolset>msvc:<runtime-link>static
+ <toolset>msvc:<link>static
+ <toolset>msvc:<warnings>all
+ <toolset>gcc:<cxxflags>-Wall
+ <toolset>gcc:<cxxflags>-Wextra
+ ;
+
+lib gmp ;
+lib mpfr ;
+
+exe has_gmp : has_gmp.cpp gmp :
<include>$(gmp_path) <include>$(gmp_path)/mpfr <include>$(gmp_path)/gmpfrxx ;
-obj has_mpfr : has_mpfr.cpp :
+exe has_mpfr : has_mpfr.cpp mpfr gmp :
<include>$(mpfr_path) <include>$(gmp_path)/mpfr <include>$(gmp_path)/gmpfrxx <include>$(gmp_path) ;
obj has_tommath : has_tommath.cpp :
<include>$(tommath_path) ;
Modified: trunk/libs/multiprecision/config/has_gmp.cpp
==============================================================================
--- trunk/libs/multiprecision/config/has_gmp.cpp (original)
+++ trunk/libs/multiprecision/config/has_gmp.cpp 2012-11-20 13:50:08 EST (Tue, 20 Nov 2012)
@@ -15,6 +15,12 @@
#error "Incompatible GMP version"
#endif
+int main()
+{
+ mpz_t integ;
+ mpz_init (integ);
+ mpz_clear (integ);
-
+ return 0;
+}
Modified: trunk/libs/multiprecision/config/has_mpfr.cpp
==============================================================================
--- trunk/libs/multiprecision/config/has_mpfr.cpp (original)
+++ trunk/libs/multiprecision/config/has_mpfr.cpp 2012-11-20 13:50:08 EST (Tue, 20 Nov 2012)
@@ -17,4 +17,18 @@
#error "Incompatible MPFR version"
#endif
+#ifdef __GNUC__
+#pragma message "__GNU_MP_VERSION=" BOOST_STRINGIZE(__GNU_MP_VERSION)
+#pragma message "__GNU_MP_VERSION_MINOR=" BOOST_STRINGIZE(__GNU_MP_VERSION_MINOR)
+#endif
+
+#if (__GNU_MP_VERSION < 4) || ((__GNU_MP_VERSION == 4) && (__GNU_MP_VERSION_MINOR < 2))
+#error "Incompatible GMP version"
+#endif
+
+int main()
+{
+ mpfr_buildopt_tls_p();
+ return 0;
+}
Modified: trunk/libs/multiprecision/test/Jamfile.v2
==============================================================================
--- trunk/libs/multiprecision/test/Jamfile.v2 (original)
+++ trunk/libs/multiprecision/test/Jamfile.v2 2012-11-20 13:50:08 EST (Tue, 20 Nov 2012)
@@ -158,22 +158,106 @@
: # command line
: # input files
: # requirements
- <define>TEST_CPP_INT_1A
- : test_arithmetic_cpp_int_1a ;
+ <define>TEST_CPP_INT_4
+ : test_arithmetic_cpp_int_4 ;
run test_arithmetic.cpp
: # command line
: # input files
: # requirements
- <define>TEST_CPP_INT_2A
- : test_arithmetic_cpp_int_2a ;
+ <define>TEST_CPP_INT_5
+ : test_arithmetic_cpp_int_5 ;
run test_arithmetic.cpp
: # command line
: # input files
: # requirements
- <define>TEST_CPP_INT_3A
- : test_arithmetic_cpp_int_3a ;
+ <define>TEST_CPP_INT_6
+ : test_arithmetic_cpp_int_6 ;
+
+run test_arithmetic.cpp
+ : # command line
+ : # input files
+ : # requirements
+ <define>TEST_CPP_INT_7
+ : test_arithmetic_cpp_int_7 ;
+
+run test_arithmetic.cpp
+ : # command line
+ : # input files
+ : # requirements
+ <define>TEST_CPP_INT_8
+ : test_arithmetic_cpp_int_8 ;
+
+run test_arithmetic.cpp
+ : # command line
+ : # input files
+ : # requirements
+ <define>TEST_CPP_INT_9
+ : test_arithmetic_cpp_int_9 ;
+
+run test_arithmetic.cpp
+ : # command line
+ : # input files
+ : # requirements
+ <define>TEST_CPP_INT_10
+ : test_arithmetic_cpp_int_10 ;
+
+run test_arithmetic.cpp
+ : # command line
+ : # input files
+ : # requirements
+ <define>TEST_CPP_INT_11
+ : test_arithmetic_cpp_int_11 ;
+
+run test_arithmetic.cpp
+ : # command line
+ : # input files
+ : # requirements
+ <define>TEST_CPP_INT_12
+ : test_arithmetic_cpp_int_12 ;
+
+run test_arithmetic.cpp
+ : # command line
+ : # input files
+ : # requirements
+ <define>TEST_CPP_INT_13
+ : test_arithmetic_cpp_int_13 ;
+
+run test_arithmetic.cpp
+ : # command line
+ : # input files
+ : # requirements
+ <define>TEST_CPP_INT_14
+ : test_arithmetic_cpp_int_14 ;
+
+run test_arithmetic.cpp
+ : # command line
+ : # input files
+ : # requirements
+ <define>TEST_CPP_INT_15
+ : test_arithmetic_cpp_int_15 ;
+
+run test_arithmetic.cpp
+ : # command line
+ : # input files
+ : # requirements
+ <define>TEST_CPP_INT_16
+ : test_arithmetic_cpp_int_16 ;
+
+run test_arithmetic.cpp
+ : # command line
+ : # input files
+ : # requirements
+ <define>TEST_CPP_INT_17
+ : test_arithmetic_cpp_int_17 ;
+
+run test_arithmetic.cpp
+ : # command line
+ : # input files
+ : # requirements
+ <define>TEST_CPP_INT_18
+ : test_arithmetic_cpp_int_18 ;
run test_arithmetic.cpp
: # command line
Modified: trunk/libs/multiprecision/test/test_arithmetic.cpp
==============================================================================
--- trunk/libs/multiprecision/test/test_arithmetic.cpp (original)
+++ trunk/libs/multiprecision/test/test_arithmetic.cpp 2012-11-20 13:50:08 EST (Tue, 20 Nov 2012)
@@ -15,39 +15,6 @@
#include <boost/math/common_factor_rt.hpp>
#include "test.hpp"
-#if !defined(TEST_MPF_50) && !defined(TEST_MPF) && !defined(TEST_BACKEND) && !defined(TEST_MPZ) && \
- !defined(TEST_CPP_DEC_FLOAT) && !defined(TEST_MPFR) && !defined(TEST_MPFR_50) && !defined(TEST_MPQ) \
- && !defined(TEST_TOMMATH) && !defined(TEST_TOMMATH_BOOST_RATIONAL) && !defined(TEST_MPZ_BOOST_RATIONAL)\
- && !defined(TEST_CPP_INT_1) && !defined(TEST_CPP_INT_2) && !defined(TEST_CPP_INT_3) \
- && !defined(TEST_CPP_INT_1A) && !defined(TEST_CPP_INT_2A) && !defined(TEST_CPP_INT_3A) \
- && !defined(TEST_CPP_INT_BR) && !defined(TEST_ARITHMETIC_BACKEND)
-# define TEST_MPF_50
-# define TEST_MPF
-# define TEST_BACKEND
-# define TEST_MPZ
-# define TEST_MPFR
-# define TEST_MPFR_50
-# define TEST_CPP_DEC_FLOAT
-# define TEST_MPQ
-# define TEST_TOMMATH
-# define TEST_CPP_INT_1
-# define TEST_CPP_INT_2
-# define TEST_CPP_INT_3
-# define TEST_CPP_INT_1A
-# define TEST_CPP_INT_2A
-# define TEST_CPP_INT_3A
-# define TEST_CPP_INT_BR
-# define TEST_ARITHMETIC_BACKEND
-
-#ifdef _MSC_VER
-#pragma message("CAUTION!!: No backend type specified so testing everything.... this will take some time!!")
-#endif
-#ifdef __GNUC__
-#pragma warning "CAUTION!!: No backend type specified so testing everything.... this will take some time!!"
-#endif
-
-#endif
-
#if defined(TEST_ARITHMETIC_BACKEND)
# include "../performance/arithmetic_backend.hpp"
#endif
@@ -68,7 +35,11 @@
#include <boost/multiprecision/tommath.hpp>
#include <boost/multiprecision/rational_adapter.hpp>
#endif
-#if defined(TEST_CPP_INT_1) || defined(TEST_CPP_INT_2) || defined(TEST_CPP_INT_3) || defined(TEST_CPP_INT_BR) || defined(TEST_CPP_INT_1A) || defined(TEST_CPP_INT_2A) || defined(TEST_CPP_INT_3A)
+#if defined(TEST_CPP_INT_1) || defined(TEST_CPP_INT_2) || defined(TEST_CPP_INT_3) || defined(TEST_CPP_INT_4)\
+ || defined(TEST_CPP_INT_5) || defined(TEST_CPP_INT_6) || defined(TEST_CPP_INT_7) || defined(TEST_CPP_INT_8)\
+ || defined(TEST_CPP_INT_9) || defined(TEST_CPP_INT_10) || defined(TEST_CPP_INT_11) || defined(TEST_CPP_INT_12)\
+ || defined(TEST_CPP_INT_13) || defined(TEST_CPP_INT_14) || defined(TEST_CPP_INT_15) || defined(TEST_CPP_INT_16)\
+ || defined(TEST_CPP_INT_17) || defined(TEST_CPP_INT_18) || defined(TEST_CPP_INT_BR)
#include <boost/multiprecision/cpp_int.hpp>
#endif
@@ -154,7 +125,11 @@
template <>
struct is_twos_complement_integer<boost::multiprecision::tom_int> : public boost::mpl::false_ {};
#endif
-#if defined(TEST_CPP_INT_1) || defined(TEST_CPP_INT_2) || defined(TEST_CPP_INT_3) || defined(TEST_CPP_INT_BR) || defined(TEST_CPP_INT_1A) || defined(TEST_CPP_INT_2A) || defined(TEST_CPP_INT_3A)
+#if defined(TEST_CPP_INT_1) || defined(TEST_CPP_INT_2) || defined(TEST_CPP_INT_3) || defined(TEST_CPP_INT_4)\
+ || defined(TEST_CPP_INT_5) || defined(TEST_CPP_INT_6) || defined(TEST_CPP_INT_7) || defined(TEST_CPP_INT_8)\
+ || defined(TEST_CPP_INT_9) || defined(TEST_CPP_INT_10) || defined(TEST_CPP_INT_11) || defined(TEST_CPP_INT_12)\
+ || defined(TEST_CPP_INT_13) || defined(TEST_CPP_INT_14) || defined(TEST_CPP_INT_15) || defined(TEST_CPP_INT_16)\
+ || defined(TEST_CPP_INT_17) || defined(TEST_CPP_INT_18) || defined(TEST_CPP_INT_BR)
template <unsigned MinBits, unsigned MaxBits, boost::multiprecision::cpp_integer_type SignType, class Allocator, boost::multiprecision::expression_template_option ExpressionTemplates>
struct is_twos_complement_integer<boost::multiprecision::number<boost::multiprecision::cpp_int_backend<MinBits, MaxBits, SignType, boost::multiprecision::checked, Allocator>, ExpressionTemplates> > : public boost::mpl::false_ {};
#endif
@@ -201,7 +176,11 @@
typedef boost::multiprecision::number< boost::multiprecision::mpfr_float_backend<D/2> > type;
};
#endif
-#if defined(TEST_CPP_INT_1) || defined(TEST_CPP_INT_2) || defined(TEST_CPP_INT_3) || defined(TEST_CPP_INT_BR) || defined(TEST_CPP_INT_1A) || defined(TEST_CPP_INT_2A) || defined(TEST_CPP_INT_3A)
+#if defined(TEST_CPP_INT_1) || defined(TEST_CPP_INT_2) || defined(TEST_CPP_INT_3) || defined(TEST_CPP_INT_4)\
+ || defined(TEST_CPP_INT_5) || defined(TEST_CPP_INT_6) || defined(TEST_CPP_INT_7) || defined(TEST_CPP_INT_8)\
+ || defined(TEST_CPP_INT_9) || defined(TEST_CPP_INT_10) || defined(TEST_CPP_INT_11) || defined(TEST_CPP_INT_12)\
+ || defined(TEST_CPP_INT_13) || defined(TEST_CPP_INT_14) || defined(TEST_CPP_INT_15) || defined(TEST_CPP_INT_16)\
+ || defined(TEST_CPP_INT_17) || defined(TEST_CPP_INT_18) || defined(TEST_CPP_INT_BR)
template <>
struct related_type<boost::multiprecision::cpp_int>
{
@@ -1853,34 +1832,58 @@
#endif
#ifdef TEST_CPP_INT_1
test<boost::multiprecision::cpp_int>();
+#endif
+#ifdef TEST_CPP_INT_2
test<boost::multiprecision::int512_t >();
+#endif
+#ifdef TEST_CPP_INT_3
test<boost::multiprecision::uint1024_t >();
#endif
-#ifdef TEST_CPP_INT_1A
+#ifdef TEST_CPP_INT_4
test<boost::multiprecision::checked_cpp_int>();
+#endif
+#ifdef TEST_CPP_INT_5
test<boost::multiprecision::checked_int512_t >();
+#endif
+#ifdef TEST_CPP_INT_6
test<boost::multiprecision::checked_uint1024_t >();
#endif
-#ifdef TEST_CPP_INT_2
+#ifdef TEST_CPP_INT_7
test<boost::multiprecision::cpp_rational>();
+#endif
+#ifdef TEST_CPP_INT_8
test<boost::multiprecision::number<boost::multiprecision::cpp_int_backend<>, boost::multiprecision::et_off> >();
- test<boost::multiprecision::number<boost::multiprecision::cpp_int_backend<500, 500, boost::multiprecision::signed_magnitude, boost::multiprecision::unchecked, void> > >();
#endif
-#ifdef TEST_CPP_INT_2A
+#ifdef TEST_CPP_INT_9
+test<boost::multiprecision::number<boost::multiprecision::cpp_int_backend<500, 500, boost::multiprecision::signed_magnitude, boost::multiprecision::unchecked, void> > >();
+#endif
+#ifdef TEST_CPP_INT_10
test<boost::multiprecision::checked_cpp_rational>();
+#endif
+#ifdef TEST_CPP_INT_11
test<boost::multiprecision::number<boost::multiprecision::cpp_int_backend<0, 0, boost::multiprecision::signed_magnitude, boost::multiprecision::checked>, boost::multiprecision::et_off> >();
+#endif
+#ifdef TEST_CPP_INT_12
test<boost::multiprecision::number<boost::multiprecision::cpp_int_backend<500, 500, boost::multiprecision::signed_magnitude, boost::multiprecision::checked, void> > >();
#endif
-#ifdef TEST_CPP_INT_3
+#ifdef TEST_CPP_INT_13
// Again with "trivial" backends:
test<boost::multiprecision::number<boost::multiprecision::cpp_int_backend<64, 64, boost::multiprecision::signed_magnitude, boost::multiprecision::unchecked, void> > >();
+#endif
+#ifdef TEST_CPP_INT_14
test<boost::multiprecision::number<boost::multiprecision::cpp_int_backend<64, 64, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void> > >();
+#endif
+#ifdef TEST_CPP_INT_15
test<boost::multiprecision::number<boost::multiprecision::cpp_int_backend<31, 31, boost::multiprecision::signed_magnitude, boost::multiprecision::unchecked, void> > >();
#endif
-#ifdef TEST_CPP_INT_3A
+#ifdef TEST_CPP_INT_16
// Again with "trivial" checked backends:
test<boost::multiprecision::number<boost::multiprecision::cpp_int_backend<64, 64, boost::multiprecision::signed_magnitude, boost::multiprecision::checked, void> > >();
+#endif
+#ifdef TEST_CPP_INT_17
test<boost::multiprecision::number<boost::multiprecision::cpp_int_backend<64, 64, boost::multiprecision::unsigned_magnitude, boost::multiprecision::checked, void> > >();
+#endif
+#ifdef TEST_CPP_INT_18
test<boost::multiprecision::number<boost::multiprecision::cpp_int_backend<31, 31, boost::multiprecision::signed_magnitude, boost::multiprecision::checked, void> > >();
#endif
#ifdef TEST_CPP_INT_BR
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk