Test class definitions when C++14 is not available

This commit is contained in:
Peter Dimov
2021-02-28 02:52:17 +02:00
parent aa1c783aab
commit ecd38df084
9 changed files with 93 additions and 79 deletions

View File

@@ -7,15 +7,6 @@
#include <boost/core/lightweight_test.hpp>
#include <boost/core/lightweight_test_trait.hpp>
#if !defined(BOOST_DESCRIBE_CXX14)
#include <boost/config/pragma_message.hpp>
BOOST_PRAGMA_MESSAGE("Skipping test because C++14 is not available")
int main() {}
#else
struct X
{
};
@@ -44,6 +35,15 @@ struct Y: public X1, private X2, public virtual X3, private virtual X4
BOOST_DESCRIBE_STRUCT(Y, (X1, X2, X3, X4), ())
#if !defined(BOOST_DESCRIBE_CXX14)
#include <boost/config/pragma_message.hpp>
BOOST_PRAGMA_MESSAGE("Skipping test because C++14 is not available")
int main() {}
#else
#include <boost/mp11.hpp>
int main()

View File

@@ -5,15 +5,7 @@
#include <boost/describe/members.hpp>
#include <boost/describe/class.hpp>
#include <boost/core/lightweight_test.hpp>
#if !defined(BOOST_DESCRIBE_CXX14)
#include <boost/config/pragma_message.hpp>
BOOST_PRAGMA_MESSAGE("Skipping test because C++14 is not available")
int main() {}
#else
#include <boost/config.hpp>
struct X
{
@@ -41,19 +33,29 @@ public:
{
}
using Pm = int Y::*;
// using Pm = int Y::*;
typedef int Y::* Pm;
static Pm m3_pointer() noexcept
static Pm m3_pointer() BOOST_NOEXCEPT
{
return &Y::m3;
}
static Pm m4_pointer() noexcept
static Pm m4_pointer() BOOST_NOEXCEPT
{
return &Y::m4;
}
};
#if !defined(BOOST_DESCRIBE_CXX14)
#include <boost/config/pragma_message.hpp>
BOOST_PRAGMA_MESSAGE("Skipping test because C++14 is not available")
int main() {}
#else
#include <boost/mp11.hpp>
int main()

View File

@@ -5,12 +5,13 @@
#include <boost/describe/members.hpp>
#include <boost/describe/class.hpp>
#include <boost/core/lightweight_test.hpp>
#include <boost/config.hpp>
#if !defined(BOOST_DESCRIBE_CXX14)
#if !defined(BOOST_DESCRIBE_CXX11)
#include <boost/config/pragma_message.hpp>
BOOST_PRAGMA_MESSAGE("Skipping test because C++14 is not available")
BOOST_PRAGMA_MESSAGE("Skipping test because C++11 is not available")
int main() {}
#else
@@ -56,6 +57,15 @@ public:
int Y::m2 = 2;
int Y::m4 = 4;
#if !defined(BOOST_DESCRIBE_CXX14)
#include <boost/config/pragma_message.hpp>
BOOST_PRAGMA_MESSAGE("Skipping test because C++14 is not available")
int main() {}
#else
#include <boost/mp11.hpp>
int main()
@@ -179,3 +189,5 @@ int main()
}
#endif // !defined(BOOST_DESCRIBE_CXX14)
#endif // !defined(BOOST_DESCRIBE_CXX11)

View File

@@ -6,15 +6,6 @@
#include <boost/describe/class.hpp>
#include <boost/core/lightweight_test.hpp>
#if !defined(BOOST_DESCRIBE_CXX14)
#include <boost/config/pragma_message.hpp>
BOOST_PRAGMA_MESSAGE("Skipping test because C++14 is not available")
int main() {}
#else
struct X
{
void f() {}
@@ -24,6 +15,15 @@ struct X
BOOST_DESCRIBE_STRUCT(X, (), (f, g, h))
#if !defined(BOOST_DESCRIBE_CXX14)
#include <boost/config/pragma_message.hpp>
BOOST_PRAGMA_MESSAGE("Skipping test because C++14 is not available")
int main() {}
#else
#include <boost/mp11.hpp>
int main()

View File

@@ -6,15 +6,6 @@
#include <boost/describe/class.hpp>
#include <boost/core/lightweight_test.hpp>
#if !defined(BOOST_DESCRIBE_CXX14)
#include <boost/config/pragma_message.hpp>
BOOST_PRAGMA_MESSAGE("Skipping test because C++14 is not available")
int main() {}
#else
struct A1
{
int m1;
@@ -37,6 +28,15 @@ struct B: A1, A2
BOOST_DESCRIBE_STRUCT(B, (A1, A2), (m1))
#if !defined(BOOST_DESCRIBE_CXX14)
#include <boost/config/pragma_message.hpp>
BOOST_PRAGMA_MESSAGE("Skipping test because C++14 is not available")
int main() {}
#else
#include <boost/mp11.hpp>
int main()

View File

@@ -6,15 +6,6 @@
#include <boost/describe/class.hpp>
#include <boost/core/lightweight_test.hpp>
#if !defined(BOOST_DESCRIBE_CXX14)
#include <boost/config/pragma_message.hpp>
BOOST_PRAGMA_MESSAGE("Skipping test because C++14 is not available")
int main() {}
#else
class A1
{
public:
@@ -66,6 +57,15 @@ private:
BOOST_DESCRIBE_CLASS(B, (A1, A2), (m1), (m2), (m3))
};
#if !defined(BOOST_DESCRIBE_CXX14)
#include <boost/config/pragma_message.hpp>
BOOST_PRAGMA_MESSAGE("Skipping test because C++14 is not available")
int main() {}
#else
#include <boost/mp11.hpp>
int main()

View File

@@ -6,15 +6,6 @@
#include <boost/describe/class.hpp>
#include <boost/core/lightweight_test.hpp>
#if !defined(BOOST_DESCRIBE_CXX14)
#include <boost/config/pragma_message.hpp>
BOOST_PRAGMA_MESSAGE("Skipping test because C++14 is not available")
int main() {}
#else
struct A
{
int m1;
@@ -41,6 +32,15 @@ private:
int B::m1;
#if !defined(BOOST_DESCRIBE_CXX14)
#include <boost/config/pragma_message.hpp>
BOOST_PRAGMA_MESSAGE("Skipping test because C++14 is not available")
int main() {}
#else
#include <boost/mp11.hpp>
int main()

View File

@@ -8,15 +8,6 @@
#include <boost/config.hpp>
#include <boost/config/workaround.hpp>
#if !defined(BOOST_DESCRIBE_CXX14)
#include <boost/config/pragma_message.hpp>
BOOST_PRAGMA_MESSAGE("Skipping test because C++14 is not available")
int main() {}
#else
struct A
{
int m1;
@@ -45,6 +36,15 @@ struct C: public B1, public B2
BOOST_DESCRIBE_STRUCT(C, (B1, B2), (m2))
#if !defined(BOOST_DESCRIBE_CXX14)
#include <boost/config/pragma_message.hpp>
BOOST_PRAGMA_MESSAGE("Skipping test because C++14 is not available")
int main() {}
#else
#include <boost/mp11.hpp>
int main()

View File

@@ -5,17 +5,6 @@
#include <boost/describe.hpp>
#include <boost/core/lightweight_test.hpp>
#if !defined(BOOST_DESCRIBE_CXX14)
#include <boost/config/pragma_message.hpp>
BOOST_PRAGMA_MESSAGE("Skipping test because C++14 is not available")
int main() {}
#else
BOOST_DEFINE_ENUM(E, v1, v2, v3)
struct X
{
int m;
@@ -30,6 +19,17 @@ struct Y: public X
BOOST_DESCRIBE_STRUCT(Y, (X), (m))
#if !defined(BOOST_DESCRIBE_CXX14)
#include <boost/config/pragma_message.hpp>
BOOST_PRAGMA_MESSAGE("Skipping test because C++14 is not available")
int main() {}
#else
BOOST_DEFINE_ENUM(E, v1, v2, v3)
#include <boost/mp11.hpp>
int main()