mirror of
https://github.com/ETLCPP/etl.git
synced 2026-10-28 18:07:10 +08:00
Conversion of static to C++14 compatinility
This commit is contained in:
parent
6e686d4799
commit
aa1d7f0f7f
4
.gitignore
vendored
4
.gitignore
vendored
@ -379,3 +379,7 @@ test/vs2022/Debug MSVC - No STL - Force Built-ins
|
||||
test/temp
|
||||
test/vs2022/Debug MSVC C++14
|
||||
test/vs2022/Debug MSVC C++20 - No STL
|
||||
build-test-Desktop_x86_windows_msvc2019_pe_64bit-Debug
|
||||
test/vs2022/Debug MSVC C++14 - No STL
|
||||
test/log.txt
|
||||
test/etl_error_handler/log.txt
|
||||
|
||||
@ -144,8 +144,19 @@ namespace etl
|
||||
{
|
||||
public:
|
||||
|
||||
typedef size_t size_type;
|
||||
|
||||
static ETL_CONSTANT uint_least8_t IS_TRUNCATED = etl::bit<0>::value;
|
||||
static ETL_CONSTANT uint_least8_t CLEAR_AFTER_USE = etl::bit<1>::value;
|
||||
|
||||
#if ETL_USING_CPP11
|
||||
static constexpr size_type npos = etl::integral_limits<size_type>::max;
|
||||
#else
|
||||
enum
|
||||
{
|
||||
npos = etl::integral_limits<size_type>::max
|
||||
};
|
||||
#endif
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
@ -153,6 +164,9 @@ namespace etl
|
||||
|
||||
template <typename T>
|
||||
ETL_CONSTANT uint_least8_t string_base_statics<T>::CLEAR_AFTER_USE;
|
||||
|
||||
template <typename T>
|
||||
ETL_CONSTANT typename string_base_statics<T>::size_type string_base_statics<T>::npos;
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
@ -162,15 +176,6 @@ namespace etl
|
||||
|
||||
typedef size_t size_type;
|
||||
|
||||
#if ETL_USING_CPP11
|
||||
static constexpr size_type npos = etl::integral_limits<size_type>::max;
|
||||
#else
|
||||
enum
|
||||
{
|
||||
npos = etl::integral_limits<size_type>::max
|
||||
};
|
||||
#endif
|
||||
|
||||
//*************************************************************************
|
||||
/// Gets the current size of the string.
|
||||
///\return The current size of the string.
|
||||
|
||||
@ -174,27 +174,29 @@ namespace etl
|
||||
template <typename T = void>
|
||||
class ifsm_state_helper
|
||||
{
|
||||
public:
|
||||
|
||||
// Pass this whenever no state change is desired.
|
||||
// The highest unsigned value of fsm_state_id_t.
|
||||
static ETL_CONSTANT fsm_state_id_t No_State_Change = etl::integral_limits<fsm_state_id_t>::max;
|
||||
// Pass this when this event also needs to be passed to the parent.
|
||||
static ETL_CONSTANT fsm_state_id_t Pass_To_Parent = No_State_Change - 1U;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
ETL_CONSTANT fsm_state_id_t ifsm_state_helper<T>::No_State_Change;
|
||||
|
||||
template <typename T>
|
||||
ETL_CONSTANT fsm_state_id_t ifsm_state_helper<T>::Pass_To_Parent;
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
/// Interface class for FSM states.
|
||||
//***************************************************************************
|
||||
class ifsm_state : private_fsm::ifsm_state_helper<>
|
||||
class ifsm_state : public private_fsm::ifsm_state_helper<>
|
||||
{
|
||||
public:
|
||||
|
||||
// Pass this whenever no state change is desired.
|
||||
// The highest unsigned value of fsm_state_id_t.
|
||||
static ETL_CONSTANT fsm_state_id_t No_State_Change = etl::integral_limits<fsm_state_id_t>::max;
|
||||
// Pass this when this event also needs to be passed to the parent.
|
||||
static ETL_CONSTANT fsm_state_id_t Pass_To_Parent = No_State_Change - 1U;
|
||||
|
||||
/// Allows ifsm_state functions to be private.
|
||||
friend class etl::fsm;
|
||||
friend class etl::hfsm;
|
||||
|
||||
@ -57,6 +57,11 @@ namespace etl
|
||||
{
|
||||
}
|
||||
|
||||
ETL_CONSTEXPR20 reference_wrapper(const reference_wrapper& rhs) ETL_NOEXCEPT
|
||||
: t(rhs.t)
|
||||
{
|
||||
}
|
||||
|
||||
ETL_CONSTEXPR20 reference_wrapper<T>& operator = (const reference_wrapper& rhs) ETL_NOEXCEPT
|
||||
{
|
||||
t = rhs.t;
|
||||
|
||||
@ -193,18 +193,27 @@ namespace etl
|
||||
template <typename T = void>
|
||||
class ifsm_state_helper
|
||||
{
|
||||
public:
|
||||
|
||||
// Pass this whenever no state change is desired.
|
||||
// The highest unsigned value of fsm_state_id_t.
|
||||
static ETL_CONSTANT fsm_state_id_t No_State_Change = etl::integral_limits<fsm_state_id_t>::max;
|
||||
|
||||
// Pass this when this event also needs to be passed to the parent.
|
||||
static ETL_CONSTANT fsm_state_id_t Pass_To_Parent = No_State_Change - 1U;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
ETL_CONSTANT fsm_state_id_t ifsm_state_helper<T>::No_State_Change;
|
||||
|
||||
template <typename T>
|
||||
ETL_CONSTANT fsm_state_id_t ifsm_state_helper<T>::Pass_To_Parent;
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
/// Interface class for FSM states.
|
||||
//***************************************************************************
|
||||
class ifsm_state : private_fsm::ifsm_state_helper<>
|
||||
class ifsm_state : public private_fsm::ifsm_state_helper<>
|
||||
{
|
||||
public:
|
||||
|
||||
|
||||
@ -483,7 +483,7 @@ namespace etl
|
||||
for n in range(1, int(Handlers)):
|
||||
cog.out("T%s, " % n)
|
||||
cog.outl("T%s>::value, int>::type>" % int(Handlers))
|
||||
cog.outl(" explicit message_packet(TMessage&& msg)")
|
||||
cog.outl(" explicit message_packet(TMessage&& /*msg*/)")
|
||||
cog.outl(" : valid(true)")
|
||||
cog.outl(" {")
|
||||
generate_static_assert_cpp11(int(Handlers))
|
||||
@ -767,7 +767,7 @@ namespace etl
|
||||
for t in range(1, n):
|
||||
cog.out("T%s, " % t)
|
||||
cog.outl("T%s>::value, int>::type>" % n)
|
||||
cog.outl(" explicit message_packet(TMessage&& msg)")
|
||||
cog.outl(" explicit message_packet(TMessage&& /*msg*/)")
|
||||
cog.outl(" : valid(true)")
|
||||
cog.outl(" {")
|
||||
generate_static_assert_cpp11(n)
|
||||
|
||||
@ -137,14 +137,14 @@ namespace etl
|
||||
template <typename T, typename T1, typename... TRest>
|
||||
struct id_from_type_helper
|
||||
{
|
||||
static constexpr size_t value = etl::is_same<T, typename T1::type>::value ? T1::ID : id_from_type_helper<T, TRest...>::value;
|
||||
static constexpr size_t value = etl::is_same<T, typename T1::type>::value ? size_t(T1::ID) : id_from_type_helper<T, TRest...>::value;
|
||||
};
|
||||
|
||||
// Specialisation for 1 type pair.
|
||||
template <typename T, typename T1>
|
||||
struct id_from_type_helper<T, T1>
|
||||
{
|
||||
static constexpr size_t value = etl::is_same<T, typename T1::type>::value ? T1::ID : UNKNOWN;
|
||||
static constexpr size_t value = etl::is_same<T, typename T1::type>::value ? size_t(T1::ID) : UNKNOWN;
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
@ -1622,99 +1622,71 @@ namespace etl
|
||||
//*********************************************
|
||||
// is_assignable
|
||||
template<typename T1, typename T2>
|
||||
struct is_assignable : public std::is_assignable<T1, T2>
|
||||
{
|
||||
};
|
||||
using is_assignable = std::is_assignable<T1, T2>;
|
||||
|
||||
//*********************************************
|
||||
// is_constructible
|
||||
template<typename T, typename... TArgs>
|
||||
struct is_constructible : public std::is_constructible<T, TArgs...>
|
||||
{
|
||||
};
|
||||
using is_constructible = std::is_constructible<T, TArgs...>;
|
||||
|
||||
//*********************************************
|
||||
// is_copy_constructible
|
||||
template <typename T>
|
||||
struct is_copy_constructible : public std::is_copy_constructible<T>
|
||||
{
|
||||
};
|
||||
using is_copy_constructible = std::is_copy_constructible<T>;
|
||||
|
||||
//*********************************************
|
||||
// is_move_constructible
|
||||
template <typename T>
|
||||
struct is_move_constructible : public std::is_move_constructible<T>
|
||||
{
|
||||
};
|
||||
using is_move_constructible = std::is_move_constructible<T>;
|
||||
|
||||
//*********************************************
|
||||
// is_trivially_constructible
|
||||
#if ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED
|
||||
template <typename T>
|
||||
struct is_trivially_constructible : public std::is_trivially_constructible<T>
|
||||
{
|
||||
};
|
||||
using is_trivially_constructible = std::is_trivially_constructible<T>;
|
||||
#else
|
||||
template <typename T>
|
||||
struct is_trivially_constructible : public etl::bool_constant<etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>
|
||||
{
|
||||
};
|
||||
using is_trivially_constructible = etl::bool_constant<etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>;
|
||||
#endif
|
||||
|
||||
//*********************************************
|
||||
// is_trivially_copy_constructible
|
||||
#if ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED
|
||||
template <typename T>
|
||||
struct is_trivially_copy_constructible : public std::is_trivially_copy_constructible<T>
|
||||
{
|
||||
};
|
||||
using is_trivially_copy_constructible = std::is_trivially_copy_constructible<T>;
|
||||
#else
|
||||
template <typename T>
|
||||
struct is_trivially_copy_constructible : public etl::bool_constant<etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>
|
||||
{
|
||||
};
|
||||
using is_trivially_copy_constructible = etl::bool_constant<etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>;
|
||||
#endif
|
||||
|
||||
//*********************************************
|
||||
// is_trivially_destructible
|
||||
#if ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED
|
||||
template <typename T>
|
||||
struct is_trivially_destructible : public std::is_trivially_destructible<T>
|
||||
{
|
||||
};
|
||||
using is_trivially_destructible = std::is_trivially_destructible<T>;
|
||||
#else
|
||||
template <typename T>
|
||||
struct is_trivially_destructible : public etl::bool_constant<etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>
|
||||
{
|
||||
};
|
||||
using is_trivially_destructible = etl::bool_constant<etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>;
|
||||
#endif
|
||||
|
||||
//*********************************************
|
||||
// is_trivially_copy_assignable
|
||||
#if ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED
|
||||
template <typename T>
|
||||
struct is_trivially_copy_assignable : public std::is_trivially_copy_assignable<T>
|
||||
{
|
||||
};
|
||||
using is_trivially_copy_assignable = std::is_trivially_copy_assignable<T>;
|
||||
#else
|
||||
template <typename T>
|
||||
struct is_trivially_copy_assignable : public etl::bool_constant<etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>
|
||||
{
|
||||
};
|
||||
using is_trivially_copy_assignable = etl::bool_constant<etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>;
|
||||
#endif
|
||||
|
||||
//*********************************************
|
||||
// is_trivially_copyable
|
||||
#if ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED
|
||||
template <typename T>
|
||||
struct is_trivially_copyable : public std::is_trivially_copyable<T>
|
||||
{
|
||||
};
|
||||
using is_trivially_copyable = std::is_trivially_copyable<T>;
|
||||
#else
|
||||
template <typename T>
|
||||
struct is_trivially_copyable : public etl::bool_constant<etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>
|
||||
{
|
||||
};
|
||||
using is_trivially_copyable = etl::bool_constant<etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>;
|
||||
#endif
|
||||
|
||||
#elif defined(ETL_USE_TYPE_TRAITS_BUILTINS) && !defined(ETL_USER_DEFINED_TYPE_TRAITS)
|
||||
|
||||
@ -45,8 +45,422 @@ SOFTWARE.
|
||||
///\ingroup utilities
|
||||
//*****************************************************************************
|
||||
|
||||
#ifndef LLONG_MAX
|
||||
#define LLONG_MAX 9223372036854775807LL
|
||||
#endif
|
||||
|
||||
#ifndef LLONG_MIN
|
||||
#define LLONG_MIN (-LLONG_MAX - 1LL)
|
||||
#endif
|
||||
|
||||
#ifndef ULLONG_MAX
|
||||
#define ULLONG_MAX 18446744073709551615ULL
|
||||
#endif
|
||||
|
||||
namespace etl
|
||||
{
|
||||
namespace private_integral_limits
|
||||
{
|
||||
//*****************************************************************************
|
||||
/// The technique of using templated base classes to declare and define the statics
|
||||
/// is to get around the limits of the One Definition Rule (ODR) that occurs when
|
||||
/// the top level integral_limits classes are specialised. This issue currently seems
|
||||
/// to only be apparent for GCC/C++14.
|
||||
/// In C++17 and above this is not necessary, as the inline keyword may be used.
|
||||
/// At the time of writing, the ETL is generally aimed to be compatible with C++98 and above.
|
||||
//*****************************************************************************
|
||||
|
||||
//*********************************
|
||||
// signed char
|
||||
template <typename T = void>
|
||||
struct statics_signed_char
|
||||
{
|
||||
typedef signed char value_type;
|
||||
|
||||
static ETL_CONSTANT signed char min = SCHAR_MIN;
|
||||
static ETL_CONSTANT signed char max = SCHAR_MAX;
|
||||
static ETL_CONSTANT int bits = CHAR_BIT;
|
||||
static ETL_CONSTANT bool is_signed = etl::is_signed<signed char>::value;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
ETL_CONSTANT signed char statics_signed_char<T>::min;
|
||||
|
||||
template <typename T>
|
||||
ETL_CONSTANT signed char statics_signed_char<T>::max;
|
||||
|
||||
template <typename T>
|
||||
ETL_CONSTANT int statics_signed_char<T>::bits;
|
||||
|
||||
template <typename T>
|
||||
ETL_CONSTANT bool statics_signed_char<T>::is_signed;
|
||||
|
||||
//***********************************
|
||||
// unsigned char
|
||||
template <typename T = void>
|
||||
struct statics_unsigned_char
|
||||
{
|
||||
typedef unsigned char value_type;
|
||||
|
||||
static ETL_CONSTANT unsigned char min = 0;
|
||||
static ETL_CONSTANT unsigned char max = UCHAR_MAX;
|
||||
static ETL_CONSTANT int bits = CHAR_BIT;
|
||||
static ETL_CONSTANT bool is_signed = etl::is_signed<unsigned char>::value;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
ETL_CONSTANT unsigned char statics_unsigned_char<T>::min;
|
||||
|
||||
template <typename T>
|
||||
ETL_CONSTANT unsigned char statics_unsigned_char<T>::max;
|
||||
|
||||
template <typename T>
|
||||
ETL_CONSTANT int statics_unsigned_char<T>::bits;
|
||||
|
||||
template <typename T>
|
||||
ETL_CONSTANT bool statics_unsigned_char<T>::is_signed;
|
||||
|
||||
//***********************************
|
||||
// char
|
||||
template <typename T = void>
|
||||
struct statics_char
|
||||
{
|
||||
typedef char value_type;
|
||||
|
||||
static ETL_CONSTANT char min = (etl::is_signed<char>::value) ? SCHAR_MIN : 0;
|
||||
static ETL_CONSTANT char max = (etl::is_signed<char>::value) ? SCHAR_MAX : static_cast<char>(UCHAR_MAX);
|
||||
static ETL_CONSTANT int bits = CHAR_BIT;
|
||||
static ETL_CONSTANT bool is_signed = etl::is_signed<char>::value;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
ETL_CONSTANT char statics_char<T>::min;
|
||||
|
||||
template <typename T>
|
||||
ETL_CONSTANT char statics_char<T>::max;
|
||||
|
||||
template <typename T>
|
||||
ETL_CONSTANT int statics_char<T>::bits;
|
||||
|
||||
template <typename T>
|
||||
ETL_CONSTANT bool statics_char<T>::is_signed;
|
||||
|
||||
//***********************************
|
||||
// wchar_t
|
||||
template <typename T = void>
|
||||
struct statics_wchar_t
|
||||
{
|
||||
typedef wchar_t value_type;
|
||||
|
||||
static ETL_CONSTANT wchar_t min = WCHAR_MIN;
|
||||
static ETL_CONSTANT wchar_t max = WCHAR_MAX;
|
||||
static ETL_CONSTANT int bits = CHAR_BIT * sizeof(wchar_t);
|
||||
static ETL_CONSTANT bool is_signed = etl::is_signed<wchar_t>::value;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
ETL_CONSTANT wchar_t statics_wchar_t<T>::min;
|
||||
|
||||
template <typename T>
|
||||
ETL_CONSTANT wchar_t statics_wchar_t<T>::max;
|
||||
|
||||
template <typename T>
|
||||
ETL_CONSTANT int statics_wchar_t<T>::bits;
|
||||
|
||||
template <typename T>
|
||||
ETL_CONSTANT bool statics_wchar_t<T>::is_signed;
|
||||
|
||||
//***********************************
|
||||
// short
|
||||
#if defined(ETL_COMPILER_MICROSOFT)
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable : 4309)
|
||||
#endif
|
||||
|
||||
template <typename T = void>
|
||||
struct statics_short
|
||||
{
|
||||
typedef short value_type;
|
||||
|
||||
static ETL_CONSTANT short min = SHRT_MIN;
|
||||
static ETL_CONSTANT short max = SHRT_MAX;
|
||||
static ETL_CONSTANT int bits = CHAR_BIT * (sizeof(short) / sizeof(char));
|
||||
static ETL_CONSTANT bool is_signed = etl::is_signed<short>::value;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
ETL_CONSTANT short statics_short<T>::min;
|
||||
|
||||
template <typename T>
|
||||
ETL_CONSTANT short statics_short<T>::max;
|
||||
|
||||
template <typename T>
|
||||
ETL_CONSTANT int statics_short<T>::bits;
|
||||
|
||||
template <typename T>
|
||||
ETL_CONSTANT bool statics_short<T>::is_signed;
|
||||
|
||||
#if defined(ETL_COMPILER_MICROSOFT)
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
//***********************************
|
||||
// unsigned short
|
||||
template <typename T = void>
|
||||
struct statics_unsigned_short
|
||||
{
|
||||
typedef unsigned short value_type;
|
||||
|
||||
static ETL_CONSTANT unsigned short min = 0;
|
||||
static ETL_CONSTANT unsigned short max = USHRT_MAX;
|
||||
static ETL_CONSTANT int bits = CHAR_BIT * (sizeof(unsigned short) / sizeof(char));
|
||||
static ETL_CONSTANT bool is_signed = etl::is_signed<unsigned short>::value;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
ETL_CONSTANT unsigned short statics_unsigned_short<T>::min;
|
||||
|
||||
template <typename T>
|
||||
ETL_CONSTANT unsigned short statics_unsigned_short<T>::max;
|
||||
|
||||
template <typename T>
|
||||
ETL_CONSTANT int statics_unsigned_short<T>::bits;
|
||||
|
||||
template <typename T>
|
||||
ETL_CONSTANT bool statics_unsigned_short<T>::is_signed;
|
||||
|
||||
//***********************************
|
||||
// int
|
||||
template <typename T = void>
|
||||
struct statics_int
|
||||
{
|
||||
typedef int value_type;
|
||||
|
||||
static ETL_CONSTANT int min = INT_MIN;
|
||||
static ETL_CONSTANT int max = INT_MAX;
|
||||
static ETL_CONSTANT int bits = CHAR_BIT * (sizeof(int) / sizeof(char));
|
||||
static ETL_CONSTANT bool is_signed = etl::is_signed<int>::value;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
ETL_CONSTANT int statics_int<T>::min;
|
||||
|
||||
template <typename T>
|
||||
ETL_CONSTANT int statics_int<T>::max;
|
||||
|
||||
template <typename T>
|
||||
ETL_CONSTANT int statics_int<T>::bits;
|
||||
|
||||
template <typename T>
|
||||
ETL_CONSTANT bool statics_int<T>::is_signed;
|
||||
|
||||
//***********************************
|
||||
// unsigned int
|
||||
template <typename T = void>
|
||||
struct statics_unsigned_int
|
||||
{
|
||||
typedef unsigned int value_type;
|
||||
|
||||
static ETL_CONSTANT unsigned int min = 0;
|
||||
static ETL_CONSTANT unsigned int max = UINT_MAX;
|
||||
static ETL_CONSTANT int bits = CHAR_BIT * (sizeof(unsigned int) / sizeof(char));
|
||||
static ETL_CONSTANT bool is_signed = etl::is_signed<unsigned int>::value;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
ETL_CONSTANT unsigned int statics_unsigned_int<T>::min;
|
||||
|
||||
template <typename T>
|
||||
ETL_CONSTANT unsigned int statics_unsigned_int<T>::max;
|
||||
|
||||
template <typename T>
|
||||
ETL_CONSTANT int statics_unsigned_int<T>::bits;
|
||||
|
||||
template <typename T>
|
||||
ETL_CONSTANT bool statics_unsigned_int<T>::is_signed;
|
||||
|
||||
//***********************************
|
||||
// long
|
||||
template <typename T = void>
|
||||
struct statics_long
|
||||
{
|
||||
typedef long value_type;
|
||||
|
||||
static ETL_CONSTANT long min = LONG_MIN;
|
||||
static ETL_CONSTANT long max = LONG_MAX;
|
||||
static ETL_CONSTANT int bits = CHAR_BIT * (sizeof(long) / sizeof(char));
|
||||
static ETL_CONSTANT bool is_signed = etl::is_signed<long>::value;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
ETL_CONSTANT long statics_long<T>::min;
|
||||
|
||||
template <typename T>
|
||||
ETL_CONSTANT long statics_long<T>::max;
|
||||
|
||||
template <typename T>
|
||||
ETL_CONSTANT int statics_long<T>::bits;
|
||||
|
||||
template <typename T>
|
||||
ETL_CONSTANT bool statics_long<T>::is_signed;
|
||||
|
||||
//***********************************
|
||||
// unsigned long
|
||||
template <typename T = void>
|
||||
struct statics_unsigned_long
|
||||
{
|
||||
typedef unsigned long value_type;
|
||||
|
||||
static ETL_CONSTANT unsigned long min = 0;
|
||||
static ETL_CONSTANT unsigned long max = ULONG_MAX;
|
||||
static ETL_CONSTANT int bits = CHAR_BIT * (sizeof(unsigned long) / sizeof(char));
|
||||
static ETL_CONSTANT bool is_signed = etl::is_signed<unsigned long>::value;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
ETL_CONSTANT unsigned long statics_unsigned_long<T>::min;
|
||||
|
||||
template <typename T>
|
||||
ETL_CONSTANT unsigned long statics_unsigned_long<T>::max;
|
||||
|
||||
template <typename T>
|
||||
ETL_CONSTANT int statics_unsigned_long<T>::bits;
|
||||
|
||||
template <typename T>
|
||||
ETL_CONSTANT bool statics_unsigned_long<T>::is_signed;
|
||||
|
||||
//***********************************
|
||||
// long long
|
||||
template <typename T = void>
|
||||
struct statics_long_long
|
||||
{
|
||||
typedef long long value_type;
|
||||
|
||||
static ETL_CONSTANT long long min = LLONG_MIN;
|
||||
static ETL_CONSTANT long long max = LLONG_MAX;
|
||||
static ETL_CONSTANT int bits = CHAR_BIT * (sizeof(long long) / sizeof(char));
|
||||
static ETL_CONSTANT bool is_signed = etl::is_signed<long long>::value;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
ETL_CONSTANT long long statics_long_long<T>::min;
|
||||
|
||||
template <typename T>
|
||||
ETL_CONSTANT long long statics_long_long<T>::max;
|
||||
|
||||
template <typename T>
|
||||
ETL_CONSTANT int statics_long_long<T>::bits;
|
||||
|
||||
template <typename T>
|
||||
ETL_CONSTANT bool statics_long_long<T>::is_signed;
|
||||
|
||||
//***********************************
|
||||
// unsigned long long
|
||||
template <typename T = void>
|
||||
struct statics_unsigned_long_long
|
||||
{
|
||||
typedef unsigned long value_type;
|
||||
|
||||
static ETL_CONSTANT unsigned long long min = 0;
|
||||
static ETL_CONSTANT unsigned long long max = ULLONG_MAX;
|
||||
static ETL_CONSTANT int bits = CHAR_BIT * (sizeof(unsigned long long) / sizeof(char));
|
||||
static ETL_CONSTANT bool is_signed = etl::is_signed<unsigned long long>::value;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
ETL_CONSTANT unsigned long long statics_unsigned_long_long<T>::min;
|
||||
|
||||
template <typename T>
|
||||
ETL_CONSTANT unsigned long long statics_unsigned_long_long<T>::max;
|
||||
|
||||
template <typename T>
|
||||
ETL_CONSTANT int statics_unsigned_long_long<T>::bits;
|
||||
|
||||
template <typename T>
|
||||
ETL_CONSTANT bool statics_unsigned_long_long<T>::is_signed;
|
||||
|
||||
#if ETL_HAS_NATIVE_CHAR8_T
|
||||
//***********************************
|
||||
// char8_t
|
||||
template <typename T = void>
|
||||
struct statics_char8_t
|
||||
{
|
||||
typedef char8_t value_type;
|
||||
|
||||
static ETL_CONSTANT char8_t min = (etl::is_signed<char8_t>::value) ? SCHAR_MIN : 0;
|
||||
static ETL_CONSTANT char8_t max = (etl::is_signed<char8_t>::value) ? SCHAR_MAX : static_cast<char8_t>(UCHAR_MAX);
|
||||
static ETL_CONSTANT int bits = CHAR_BIT;
|
||||
static ETL_CONSTANT bool is_signed = etl::is_signed<char8_t>::value;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
ETL_CONSTANT char8_t statics_char8_t<T>::min;
|
||||
|
||||
template <typename T>
|
||||
ETL_CONSTANT char8_t statics_char8_t<T>::max;
|
||||
|
||||
template <typename T>
|
||||
ETL_CONSTANT int statics_char8_t<T>::bits;
|
||||
|
||||
template <typename T>
|
||||
ETL_CONSTANT bool statics_char8_t<T>::is_signed;
|
||||
#endif
|
||||
|
||||
#if ETL_HAS_NATIVE_CHAR16_T
|
||||
//***********************************
|
||||
// char16_t
|
||||
template <typename T = void>
|
||||
struct statics_char16_t
|
||||
{
|
||||
typedef char16_t value_type;
|
||||
|
||||
static ETL_CONSTANT char16_t min = 0;
|
||||
static ETL_CONSTANT char16_t max = 0xFFFFU;
|
||||
static ETL_CONSTANT int bits = 16;
|
||||
static ETL_CONSTANT bool is_signed = false;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
ETL_CONSTANT char16_t statics_char16_t<T>::min;
|
||||
|
||||
template <typename T>
|
||||
ETL_CONSTANT char16_t statics_char16_t<T>::max;
|
||||
|
||||
template <typename T>
|
||||
ETL_CONSTANT int statics_char16_t<T>::bits;
|
||||
|
||||
template <typename T>
|
||||
ETL_CONSTANT bool statics_char16_t<T>::is_signed;
|
||||
#endif
|
||||
|
||||
#if ETL_HAS_NATIVE_CHAR32_T
|
||||
//***********************************
|
||||
// char32_t
|
||||
template <typename T = void>
|
||||
struct statics_char32_t
|
||||
{
|
||||
typedef char32_t value_type;
|
||||
|
||||
static ETL_CONSTANT char32_t min = 0;
|
||||
static ETL_CONSTANT char32_t max = 0xFFFFFFFFU;
|
||||
static ETL_CONSTANT int bits = 32;
|
||||
static ETL_CONSTANT bool is_signed = false;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
ETL_CONSTANT char32_t statics_char32_t<T>::min;
|
||||
|
||||
template <typename T>
|
||||
ETL_CONSTANT char32_t statics_char32_t<T>::max;
|
||||
|
||||
template <typename T>
|
||||
ETL_CONSTANT int statics_char32_t<T>::bits;
|
||||
|
||||
template <typename T>
|
||||
ETL_CONSTANT bool statics_char32_t<T>::is_signed;
|
||||
#endif
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
///\ingroup integral_limits
|
||||
//***************************************************************************
|
||||
@ -57,249 +471,91 @@ namespace etl
|
||||
///\ingroup integral_limits
|
||||
//***************************************************************************
|
||||
template <>
|
||||
struct integral_limits<void>
|
||||
struct integral_limits<signed char> : public private_integral_limits::statics_signed_char<>
|
||||
{
|
||||
typedef void value_type;
|
||||
|
||||
static ETL_CONSTANT int min = 0;
|
||||
static ETL_CONSTANT int max = 0;
|
||||
static ETL_CONSTANT int bits = 0;
|
||||
static ETL_CONSTANT bool is_signed = false;
|
||||
};
|
||||
|
||||
ETL_CONSTANT int integral_limits<void>::min;
|
||||
ETL_CONSTANT int integral_limits<void>::max;
|
||||
ETL_CONSTANT int integral_limits<void>::bits;
|
||||
ETL_CONSTANT bool integral_limits<void>::is_signed;
|
||||
|
||||
//***************************************************************************
|
||||
///\ingroup integral_limits
|
||||
//***************************************************************************
|
||||
template <>
|
||||
struct integral_limits<signed char>
|
||||
struct integral_limits<unsigned char> : public private_integral_limits::statics_unsigned_char<>
|
||||
{
|
||||
typedef signed char value_type;
|
||||
|
||||
static ETL_CONSTANT signed char min = SCHAR_MIN;
|
||||
static ETL_CONSTANT signed char max = SCHAR_MAX;
|
||||
static ETL_CONSTANT int bits = CHAR_BIT;
|
||||
static ETL_CONSTANT bool is_signed = etl::is_signed<signed char>::value;
|
||||
};
|
||||
|
||||
ETL_CONSTANT signed char integral_limits<signed char>::min;
|
||||
ETL_CONSTANT signed char integral_limits<signed char>::max;
|
||||
ETL_CONSTANT int integral_limits<signed char>::bits;
|
||||
ETL_CONSTANT bool integral_limits<signed char>::is_signed;
|
||||
|
||||
//***************************************************************************
|
||||
///\ingroup integral_limits
|
||||
//***************************************************************************
|
||||
|
||||
template <>
|
||||
struct integral_limits<unsigned char>
|
||||
{
|
||||
typedef unsigned char value_type;
|
||||
|
||||
static ETL_CONSTANT unsigned char min = 0;
|
||||
static ETL_CONSTANT unsigned char max = UCHAR_MAX;
|
||||
static ETL_CONSTANT int bits = CHAR_BIT;
|
||||
static ETL_CONSTANT bool is_signed = etl::is_signed<unsigned char>::value;
|
||||
};
|
||||
|
||||
ETL_CONSTANT unsigned char integral_limits<unsigned char>::min;
|
||||
ETL_CONSTANT unsigned char integral_limits<unsigned char>::max;
|
||||
ETL_CONSTANT int integral_limits<unsigned char>::bits;
|
||||
ETL_CONSTANT bool integral_limits<unsigned char>::is_signed;
|
||||
|
||||
//***************************************************************************
|
||||
///\ingroup integral_limits
|
||||
//***************************************************************************
|
||||
#if defined(ETL_COMPILER_MICROSOFT)
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable : 4309)
|
||||
#endif
|
||||
template <>
|
||||
struct integral_limits<char>
|
||||
struct integral_limits<char> : public private_integral_limits::statics_char<>
|
||||
{
|
||||
typedef char value_type;
|
||||
|
||||
static ETL_CONSTANT char min = (etl::is_signed<char>::value) ? SCHAR_MIN : 0;
|
||||
static ETL_CONSTANT char max = (etl::is_signed<char>::value) ? SCHAR_MAX : static_cast<char>(UCHAR_MAX);
|
||||
static ETL_CONSTANT int bits = CHAR_BIT;
|
||||
static ETL_CONSTANT bool is_signed = etl::is_signed<char>::value;
|
||||
};
|
||||
|
||||
ETL_CONSTANT char integral_limits<char>::min;
|
||||
ETL_CONSTANT char integral_limits<char>::max;
|
||||
ETL_CONSTANT int integral_limits<char>::bits;
|
||||
ETL_CONSTANT bool integral_limits<char>::is_signed;
|
||||
|
||||
#if defined(ETL_COMPILER_MICROSOFT)
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
//***************************************************************************
|
||||
///\ingroup integral_limits
|
||||
//***************************************************************************
|
||||
template <>
|
||||
struct integral_limits<short>
|
||||
struct integral_limits<short> : public private_integral_limits::statics_short<>
|
||||
{
|
||||
typedef short value_type;
|
||||
|
||||
static ETL_CONSTANT short min = SHRT_MIN;
|
||||
static ETL_CONSTANT short max = SHRT_MAX;
|
||||
static ETL_CONSTANT int bits = CHAR_BIT * (sizeof(short) / sizeof(char));
|
||||
static ETL_CONSTANT bool is_signed = etl::is_signed<short>::value;
|
||||
};
|
||||
|
||||
ETL_CONSTANT short integral_limits<short>::min;
|
||||
ETL_CONSTANT short integral_limits<short>::max;
|
||||
ETL_CONSTANT int integral_limits<short>::bits;
|
||||
ETL_CONSTANT bool integral_limits<short>::is_signed;
|
||||
|
||||
//***************************************************************************
|
||||
///\ingroup integral_limits
|
||||
//***************************************************************************
|
||||
template <>
|
||||
struct integral_limits<unsigned short>
|
||||
struct integral_limits<unsigned short> : public private_integral_limits::statics_unsigned_short<>
|
||||
{
|
||||
typedef unsigned short value_type;
|
||||
|
||||
static ETL_CONSTANT unsigned short min = 0;
|
||||
static ETL_CONSTANT unsigned short max = USHRT_MAX;
|
||||
static ETL_CONSTANT int bits = CHAR_BIT * (sizeof(unsigned short) / sizeof(char));
|
||||
static ETL_CONSTANT bool is_signed = etl::is_signed<unsigned short>::value;
|
||||
};
|
||||
|
||||
ETL_CONSTANT unsigned short integral_limits<unsigned short>::min;
|
||||
ETL_CONSTANT unsigned short integral_limits<unsigned short>::max;
|
||||
ETL_CONSTANT int integral_limits<unsigned short>::bits;
|
||||
ETL_CONSTANT bool integral_limits<unsigned short>::is_signed;
|
||||
|
||||
//***************************************************************************
|
||||
///\ingroup integral_limits
|
||||
//***************************************************************************
|
||||
template <>
|
||||
struct integral_limits<int>
|
||||
struct integral_limits<int> : public private_integral_limits::statics_int<>
|
||||
{
|
||||
typedef int value_type;
|
||||
|
||||
static ETL_CONSTANT int min = INT_MIN;
|
||||
static ETL_CONSTANT int max = INT_MAX;
|
||||
static ETL_CONSTANT int bits = CHAR_BIT * (sizeof(int) / sizeof(char));
|
||||
static ETL_CONSTANT bool is_signed = etl::is_signed<int>::value;
|
||||
};
|
||||
|
||||
ETL_CONSTANT int integral_limits<int>::min;
|
||||
ETL_CONSTANT int integral_limits<int>::max;
|
||||
ETL_CONSTANT int integral_limits<int>::bits;
|
||||
ETL_CONSTANT bool integral_limits<int>::is_signed;
|
||||
|
||||
//***************************************************************************
|
||||
///\ingroup integral_limits
|
||||
//***************************************************************************
|
||||
template <>
|
||||
struct integral_limits<unsigned int>
|
||||
struct integral_limits<unsigned int> : public private_integral_limits::statics_unsigned_int<>
|
||||
{
|
||||
typedef unsigned int value_type;
|
||||
|
||||
static ETL_CONSTANT unsigned int min = 0;
|
||||
static ETL_CONSTANT unsigned int max = UINT_MAX;
|
||||
static ETL_CONSTANT int bits = CHAR_BIT * (sizeof(unsigned int) / sizeof(char));
|
||||
static ETL_CONSTANT bool is_signed = etl::is_signed<unsigned int>::value;
|
||||
};
|
||||
|
||||
ETL_CONSTANT unsigned int integral_limits<unsigned int>::min;
|
||||
ETL_CONSTANT unsigned int integral_limits<unsigned int>::max;
|
||||
ETL_CONSTANT int integral_limits<unsigned int>::bits;
|
||||
ETL_CONSTANT bool integral_limits<unsigned int>::is_signed;
|
||||
|
||||
//***************************************************************************
|
||||
///\ingroup integral_limits
|
||||
//***************************************************************************
|
||||
template <>
|
||||
struct integral_limits<long>
|
||||
struct integral_limits<long> : public private_integral_limits::statics_long<>
|
||||
{
|
||||
typedef long value_type;
|
||||
|
||||
static ETL_CONSTANT long min = LONG_MIN;
|
||||
static ETL_CONSTANT long max = LONG_MAX;
|
||||
static ETL_CONSTANT int bits = CHAR_BIT * (sizeof(long) / sizeof(char));
|
||||
static ETL_CONSTANT bool is_signed = etl::is_signed<long>::value;
|
||||
};
|
||||
|
||||
ETL_CONSTANT long integral_limits<long>::min;
|
||||
ETL_CONSTANT long integral_limits<long>::max;
|
||||
ETL_CONSTANT int integral_limits<long>::bits;
|
||||
ETL_CONSTANT bool integral_limits<long>::is_signed;
|
||||
|
||||
//***************************************************************************
|
||||
///\ingroup integral_limits
|
||||
//***************************************************************************
|
||||
template <>
|
||||
struct integral_limits<unsigned long>
|
||||
struct integral_limits<unsigned long> : public private_integral_limits::statics_unsigned_long<>
|
||||
{
|
||||
typedef unsigned long value_type;
|
||||
|
||||
static ETL_CONSTANT unsigned long min = 0;
|
||||
static ETL_CONSTANT unsigned long max = ULONG_MAX;
|
||||
static ETL_CONSTANT int bits = CHAR_BIT * (sizeof(unsigned long) / sizeof(char));
|
||||
static ETL_CONSTANT bool is_signed = etl::is_signed<unsigned long>::value;
|
||||
};
|
||||
|
||||
ETL_CONSTANT unsigned long integral_limits<unsigned long>::min;
|
||||
ETL_CONSTANT unsigned long integral_limits<unsigned long>::max;
|
||||
ETL_CONSTANT int integral_limits<unsigned long>::bits;
|
||||
ETL_CONSTANT bool integral_limits<unsigned long>::is_signed;
|
||||
|
||||
#ifndef LLONG_MAX
|
||||
#define LLONG_MAX 9223372036854775807LL
|
||||
#endif
|
||||
|
||||
#ifndef LLONG_MIN
|
||||
#define LLONG_MIN (-LLONG_MAX - 1LL)
|
||||
#endif
|
||||
|
||||
#ifndef ULLONG_MAX
|
||||
#define ULLONG_MAX 18446744073709551615ULL
|
||||
#endif
|
||||
|
||||
//***************************************************************************
|
||||
///\ingroup integral_limits
|
||||
//***************************************************************************
|
||||
template <>
|
||||
struct integral_limits<long long>
|
||||
{
|
||||
typedef long long value_type;
|
||||
|
||||
static ETL_CONSTANT long long min = LLONG_MIN;
|
||||
static ETL_CONSTANT long long max = LLONG_MAX;
|
||||
static ETL_CONSTANT int bits = CHAR_BIT * (sizeof(long long) / sizeof(char));
|
||||
static ETL_CONSTANT bool is_signed = etl::is_signed<long long>::value;
|
||||
struct integral_limits<long long> : public private_integral_limits::statics_long_long<>
|
||||
{
|
||||
};
|
||||
|
||||
ETL_CONSTANT long long integral_limits<long long>::min;
|
||||
ETL_CONSTANT long long integral_limits<long long>::max;
|
||||
ETL_CONSTANT int integral_limits<long long>::bits;
|
||||
ETL_CONSTANT bool integral_limits<long long>::is_signed;
|
||||
|
||||
//***************************************************************************
|
||||
///\ingroup integral_limits
|
||||
//***************************************************************************
|
||||
template <>
|
||||
struct integral_limits<unsigned long long>
|
||||
struct integral_limits<unsigned long long> : public private_integral_limits::statics_unsigned_long_long<>
|
||||
{
|
||||
typedef unsigned long long value_type;
|
||||
|
||||
static ETL_CONSTANT unsigned long long min = 0;
|
||||
static ETL_CONSTANT unsigned long long max = ULLONG_MAX;
|
||||
static ETL_CONSTANT int bits = CHAR_BIT * (sizeof(unsigned long long) / sizeof(char));
|
||||
static ETL_CONSTANT bool is_signed = etl::is_signed<unsigned long long>::value;
|
||||
};
|
||||
|
||||
ETL_CONSTANT unsigned long long integral_limits<unsigned long long>::min;
|
||||
ETL_CONSTANT unsigned long long integral_limits<unsigned long long>::max;
|
||||
ETL_CONSTANT int integral_limits<unsigned long long>::bits;
|
||||
ETL_CONSTANT bool integral_limits<unsigned long long>::is_signed;
|
||||
}
|
||||
|
||||
#include "private/minmax_pop.h"
|
||||
|
||||
1008
include/etl/limits.h
1008
include/etl/limits.h
File diff suppressed because it is too large
Load Diff
@ -121,9 +121,19 @@ namespace etl
|
||||
using type_from_index_t = typename type_from_index<I>::type;
|
||||
};
|
||||
|
||||
//***********************************
|
||||
template <size_t Index, typename... TTypes>
|
||||
using parameter_pack_t = typename etl::parameter_pack<TTypes...>::template type_from_index_t<Index>;
|
||||
|
||||
//***********************************
|
||||
template <typename... TTypes>
|
||||
constexpr size_t parameter_pack<TTypes...>::size;
|
||||
|
||||
//***********************************
|
||||
template <typename... TTypes>
|
||||
template <typename T>
|
||||
constexpr size_t parameter_pack<TTypes...>::template index_of_type<T>::value;
|
||||
|
||||
#if ETL_USING_CPP17
|
||||
template <typename T, typename... TTypes>
|
||||
inline constexpr size_t parameter_pack_v = etl::parameter_pack<TTypes...>::template index_of_type<T>::value;
|
||||
|
||||
@ -183,6 +183,15 @@ namespace etl
|
||||
return p_bitset->test(position);
|
||||
}
|
||||
|
||||
//*******************************
|
||||
/// Copy constructor.
|
||||
//*******************************
|
||||
bit_reference(const bit_reference& other)
|
||||
: p_bitset(other.p_bitset)
|
||||
, position(other.position)
|
||||
{
|
||||
}
|
||||
|
||||
//*******************************
|
||||
/// Assignment operator.
|
||||
//*******************************
|
||||
|
||||
@ -810,7 +810,7 @@ namespace etl
|
||||
|
||||
//***************************************************************************
|
||||
template <size_t Active_Bits = 0U,
|
||||
typename TElement = void,
|
||||
typename TElement = char,
|
||||
bool IsSingleElement = etl::integral_limits<TElement>::bits == Active_Bits>
|
||||
class bitset;
|
||||
|
||||
@ -819,7 +819,7 @@ namespace etl
|
||||
/// Just defines 'npos'.
|
||||
//***************************************************************************
|
||||
template <>
|
||||
class bitset<0U, void, true> : public bitset_constants<>
|
||||
class bitset<0U, char, true> : public bitset_constants<>
|
||||
{
|
||||
};
|
||||
|
||||
@ -827,7 +827,7 @@ namespace etl
|
||||
/// Specialisation for zero bits.
|
||||
//***************************************************************************
|
||||
template <>
|
||||
class bitset<0U, void, false> : public bitset_constants<>
|
||||
class bitset<0U, char, false> : public bitset_constants<>
|
||||
{
|
||||
};
|
||||
|
||||
@ -866,6 +866,15 @@ namespace etl
|
||||
|
||||
friend class bitset;
|
||||
|
||||
//*******************************
|
||||
/// Copy constructor.
|
||||
//*******************************
|
||||
ETL_CONSTEXPR14 bit_reference(const bit_reference& other) ETL_NOEXCEPT
|
||||
: p_bitset(other.p_bitset)
|
||||
, position(other.position)
|
||||
{
|
||||
}
|
||||
|
||||
//*******************************
|
||||
/// Conversion operator.
|
||||
//*******************************
|
||||
@ -892,15 +901,6 @@ namespace etl
|
||||
return *this;
|
||||
}
|
||||
|
||||
//*******************************
|
||||
/// Copy constructor.
|
||||
//*******************************
|
||||
ETL_CONSTEXPR14 bit_reference(const bit_reference& other) ETL_NOEXCEPT
|
||||
: p_bitset(other.p_bitset)
|
||||
, position(other.position)
|
||||
{
|
||||
}
|
||||
|
||||
//*******************************
|
||||
/// Flip the bit.
|
||||
//*******************************
|
||||
@ -1751,6 +1751,15 @@ namespace etl
|
||||
|
||||
friend class bitset;
|
||||
|
||||
//*******************************
|
||||
/// Copy constructor.
|
||||
//*******************************
|
||||
ETL_CONSTEXPR14 bit_reference(const bit_reference& other) ETL_NOEXCEPT
|
||||
: p_bitset(other.p_bitset)
|
||||
, position(other.position)
|
||||
{
|
||||
}
|
||||
|
||||
//*******************************
|
||||
/// Conversion operator.
|
||||
//*******************************
|
||||
@ -1777,15 +1786,6 @@ namespace etl
|
||||
return *this;
|
||||
}
|
||||
|
||||
//*******************************
|
||||
/// Copy constructor.
|
||||
//*******************************
|
||||
ETL_CONSTEXPR14 bit_reference(const bit_reference& other) ETL_NOEXCEPT
|
||||
: p_bitset(other.p_bitset)
|
||||
, position(other.position)
|
||||
{
|
||||
}
|
||||
|
||||
//*******************************
|
||||
/// Flip the bit.
|
||||
//*******************************
|
||||
@ -2448,7 +2448,7 @@ namespace etl
|
||||
{
|
||||
//***************************************************************************
|
||||
template <size_t Active_Bits = 0U,
|
||||
typename TElement = void,
|
||||
typename TElement = char,
|
||||
bool IsSingleElement = etl::integral_limits<TElement>::bits == Active_Bits>
|
||||
class bitset_ext;
|
||||
|
||||
@ -2457,7 +2457,7 @@ namespace etl
|
||||
/// Just defines 'npos'.
|
||||
//***************************************************************************
|
||||
template <>
|
||||
class bitset_ext<0U, void, true> : public bitset_constants<>
|
||||
class bitset_ext<0U, char, true> : public bitset_constants<>
|
||||
{
|
||||
};
|
||||
|
||||
@ -2465,7 +2465,7 @@ namespace etl
|
||||
/// Specialisation for zero bits.
|
||||
//***************************************************************************
|
||||
template <>
|
||||
class bitset_ext<0U, void, false> : public bitset_constants<>
|
||||
class bitset_ext<0U, char, false> : public bitset_constants<>
|
||||
{
|
||||
};
|
||||
|
||||
@ -2506,6 +2506,15 @@ namespace etl
|
||||
|
||||
friend class bitset_ext;
|
||||
|
||||
//*******************************
|
||||
/// Copy constructor.
|
||||
//*******************************
|
||||
ETL_CONSTEXPR14 bit_reference(const bit_reference& other) ETL_NOEXCEPT
|
||||
: p_bitset(other.p_bitset)
|
||||
, position(other.position)
|
||||
{
|
||||
}
|
||||
|
||||
//*******************************
|
||||
/// Conversion operator.
|
||||
//*******************************
|
||||
@ -3381,6 +3390,15 @@ namespace etl
|
||||
|
||||
friend class bitset_ext;
|
||||
|
||||
//*******************************
|
||||
/// Copy constructor
|
||||
//*******************************
|
||||
ETL_CONSTEXPR14 bit_reference(const bit_reference& other) ETL_NOEXCEPT
|
||||
: p_bitset(other.p_bitset)
|
||||
, position(other.position)
|
||||
{
|
||||
}
|
||||
|
||||
//*******************************
|
||||
/// Conversion operator.
|
||||
//*******************************
|
||||
|
||||
@ -1352,10 +1352,10 @@ namespace etl
|
||||
/// in which every recursive instantiation of `visit_result_helper` appends
|
||||
/// more elements and give it a pass through `common_type_t`.
|
||||
//***************************************************************************
|
||||
template <template <typename...> typename, typename...>
|
||||
template <template <typename...> class, typename...>
|
||||
struct visit_result_helper;
|
||||
|
||||
template <template <typename...> typename TToInject, size_t... tAltIndices, typename TCur>
|
||||
template <template <typename...> class TToInject, size_t... tAltIndices, typename TCur>
|
||||
struct visit_result_helper<TToInject, index_sequence<tAltIndices...>, TCur>
|
||||
{
|
||||
template <size_t tIndex>
|
||||
@ -1365,7 +1365,7 @@ namespace etl
|
||||
using type = common_type_t<TToInject<var_type<tAltIndices> >...>;
|
||||
};
|
||||
|
||||
template <template <typename...> typename TToInject, size_t... tAltIndices, typename TCur, typename TNext, typename... TVs>
|
||||
template <template <typename...> class TToInject, size_t... tAltIndices, typename TCur, typename TNext, typename... TVs>
|
||||
struct visit_result_helper<TToInject, index_sequence<tAltIndices...>, TCur, TNext, TVs...>
|
||||
{
|
||||
template <size_t tIndex>
|
||||
|
||||
@ -361,8 +361,8 @@ namespace etl
|
||||
typedef typename private_smallest::best_fit_uint_type<TYPE_INDEX>::type type;
|
||||
};
|
||||
|
||||
template <uintmax_t VALUE>
|
||||
ETL_CONSTANT int smallest_uint_for_value<VALUE>::TYPE_INDEX;
|
||||
template <uintmax_t NBITS>
|
||||
ETL_CONSTANT int smallest_uint_for_value<NBITS>::TYPE_INDEX;
|
||||
|
||||
#if ETL_USING_CPP11
|
||||
template <uintmax_t VALUE>
|
||||
@ -390,8 +390,8 @@ namespace etl
|
||||
typedef typename private_smallest::best_fit_int_type<TYPE_INDEX>::type type;
|
||||
};
|
||||
|
||||
template <intmax_t VALUE>
|
||||
ETL_CONSTANT int smallest_int_for_value<VALUE>::TYPE_INDEX;
|
||||
template <intmax_t NBITS>
|
||||
ETL_CONSTANT int smallest_int_for_value<NBITS>::TYPE_INDEX;
|
||||
|
||||
#if ETL_USING_CPP11
|
||||
template <intmax_t VALUE>
|
||||
|
||||
@ -852,6 +852,9 @@ namespace etl
|
||||
template <typename T, size_t Extent>
|
||||
ETL_CONSTANT size_t span<T, Extent>::extent;
|
||||
|
||||
template <typename T>
|
||||
ETL_CONSTANT size_t span<T, etl::dynamic_extent>::extent;
|
||||
|
||||
//*************************************************************************
|
||||
/// Compare two spans for equality.
|
||||
//*************************************************************************
|
||||
|
||||
@ -60,6 +60,11 @@ namespace etl
|
||||
#endif
|
||||
};
|
||||
|
||||
#if ETL_USING_CPP11
|
||||
template <size_t VALUE, size_t I>
|
||||
constexpr size_t sqrt<VALUE, I>::value;
|
||||
#endif
|
||||
|
||||
#if ETL_USING_CPP17
|
||||
template <size_t VALUE, size_t I = 1>
|
||||
inline constexpr size_t sqrt_v = sqrt<VALUE, I>::value;
|
||||
|
||||
@ -106,8 +106,8 @@ namespace etl
|
||||
const T integral_constant<T, VALUE>::value;
|
||||
|
||||
#if ETL_USING_CPP17
|
||||
template <typename T, T VALUE>
|
||||
inline constexpr T integral_constant_v = std::integral_constant<T, VALUE>::value;
|
||||
template <typename T>
|
||||
using integral_constant_v = std::integral_constant<T>::value;
|
||||
#endif
|
||||
|
||||
#if ETL_USING_CPP11
|
||||
@ -118,11 +118,6 @@ namespace etl
|
||||
struct bool_constant : etl::integral_constant<bool, B> { };
|
||||
#endif
|
||||
|
||||
#if ETL_USING_CPP17
|
||||
template <bool B>
|
||||
inline constexpr bool bool_constant_v = std::bool_constant<B>::value;
|
||||
#endif
|
||||
|
||||
//***************************************************************************
|
||||
/// negation
|
||||
template <typename T>
|
||||
@ -816,7 +811,7 @@ namespace etl
|
||||
//***************************************************************************
|
||||
/// integral_constant
|
||||
///\ingroup type_traits
|
||||
template <typename T, T VALUE>
|
||||
template <typename T, const T VALUE>
|
||||
struct integral_constant : std::integral_constant<T, VALUE> {};
|
||||
|
||||
/// integral_constant specialisations
|
||||
@ -824,11 +819,6 @@ namespace etl
|
||||
typedef integral_constant<bool, false> false_type;
|
||||
typedef integral_constant<bool, true> true_type;
|
||||
|
||||
#if ETL_USING_CPP17
|
||||
template <typename T, T VALUE>
|
||||
inline constexpr T integral_constant_v = std::integral_constant<T, VALUE>::value;
|
||||
#endif
|
||||
|
||||
#if ETL_USING_CPP17
|
||||
template <bool B>
|
||||
using bool_constant = std::bool_constant<B>;
|
||||
@ -837,11 +827,6 @@ namespace etl
|
||||
struct bool_constant : std::integral_constant<bool, B> { };
|
||||
#endif
|
||||
|
||||
#if ETL_USING_CPP17
|
||||
template <bool B>
|
||||
inline constexpr bool bool_constant_v = std::bool_constant<B>::value;
|
||||
#endif
|
||||
|
||||
//***************************************************************************
|
||||
/// negation
|
||||
///\ingroup type_traits
|
||||
@ -1630,99 +1615,71 @@ namespace etl
|
||||
//*********************************************
|
||||
// is_assignable
|
||||
template<typename T1, typename T2>
|
||||
struct is_assignable : public std::is_assignable<T1, T2>
|
||||
{
|
||||
};
|
||||
using is_assignable = std::is_assignable<T1, T2>;
|
||||
|
||||
//*********************************************
|
||||
// is_constructible
|
||||
template<typename T, typename... TArgs>
|
||||
struct is_constructible : public std::is_constructible<T, TArgs...>
|
||||
{
|
||||
};
|
||||
using is_constructible = std::is_constructible<T, TArgs...>;
|
||||
|
||||
//*********************************************
|
||||
// is_copy_constructible
|
||||
template <typename T>
|
||||
struct is_copy_constructible : public std::is_copy_constructible<T>
|
||||
{
|
||||
};
|
||||
using is_copy_constructible = std::is_copy_constructible<T>;
|
||||
|
||||
//*********************************************
|
||||
// is_move_constructible
|
||||
template <typename T>
|
||||
struct is_move_constructible : public std::is_move_constructible<T>
|
||||
{
|
||||
};
|
||||
using is_move_constructible = std::is_move_constructible<T>;
|
||||
|
||||
//*********************************************
|
||||
// is_trivially_constructible
|
||||
#if ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED
|
||||
template <typename T>
|
||||
struct is_trivially_constructible : public std::is_trivially_constructible<T>
|
||||
{
|
||||
};
|
||||
using is_trivially_constructible = std::is_trivially_constructible<T>;
|
||||
#else
|
||||
template <typename T>
|
||||
struct is_trivially_constructible : public etl::bool_constant<etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>
|
||||
{
|
||||
};
|
||||
using is_trivially_constructible = etl::bool_constant<etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>;
|
||||
#endif
|
||||
|
||||
//*********************************************
|
||||
// is_trivially_copy_constructible
|
||||
#if ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED
|
||||
template <typename T>
|
||||
struct is_trivially_copy_constructible : public std::is_trivially_copy_constructible<T>
|
||||
{
|
||||
};
|
||||
using is_trivially_copy_constructible = std::is_trivially_copy_constructible<T>;
|
||||
#else
|
||||
template <typename T>
|
||||
struct is_trivially_copy_constructible : public etl::bool_constant<etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>
|
||||
{
|
||||
};
|
||||
using is_trivially_copy_constructible = etl::bool_constant<etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>;
|
||||
#endif
|
||||
|
||||
//*********************************************
|
||||
// is_trivially_destructible
|
||||
#if ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED
|
||||
template <typename T>
|
||||
struct is_trivially_destructible : public std::is_trivially_destructible<T>
|
||||
{
|
||||
};
|
||||
using is_trivially_destructible = std::is_trivially_destructible<T>;
|
||||
#else
|
||||
template <typename T>
|
||||
struct is_trivially_destructible : public etl::bool_constant<etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>
|
||||
{
|
||||
};
|
||||
using is_trivially_destructible = etl::bool_constant<etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>;
|
||||
#endif
|
||||
|
||||
//*********************************************
|
||||
// is_trivially_copy_assignable
|
||||
#if ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED
|
||||
template <typename T>
|
||||
struct is_trivially_copy_assignable : public std::is_trivially_copy_assignable<T>
|
||||
{
|
||||
};
|
||||
using is_trivially_copy_assignable = std::is_trivially_copy_assignable<T>;
|
||||
#else
|
||||
template <typename T>
|
||||
struct is_trivially_copy_assignable : public etl::bool_constant<etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>
|
||||
{
|
||||
};
|
||||
using is_trivially_copy_assignable = etl::bool_constant<etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>;
|
||||
#endif
|
||||
|
||||
//*********************************************
|
||||
// is_trivially_copyable
|
||||
#if ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED
|
||||
template <typename T>
|
||||
struct is_trivially_copyable : public std::is_trivially_copyable<T>
|
||||
{
|
||||
};
|
||||
using is_trivially_copyable = std::is_trivially_copyable<T>;
|
||||
#else
|
||||
template <typename T>
|
||||
struct is_trivially_copyable : public etl::bool_constant<etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>
|
||||
{
|
||||
};
|
||||
using is_trivially_copyable = etl::bool_constant<etl::is_arithmetic<T>::value || etl::is_pointer<T>::value>;
|
||||
#endif
|
||||
|
||||
#elif defined(ETL_USE_TYPE_TRAITS_BUILTINS) && !defined(ETL_USER_DEFINED_TYPE_TRAITS)
|
||||
@ -1739,9 +1696,6 @@ namespace etl
|
||||
static ETL_CONSTANT bool value = __is_assignable(T1, T2);
|
||||
};
|
||||
|
||||
template<typename T1, typename T2>
|
||||
ETL_CONSTANT bool is_assignable::value;
|
||||
|
||||
#if ETL_USING_CPP11
|
||||
//*********************************************
|
||||
// is_constructible
|
||||
@ -1750,9 +1704,6 @@ namespace etl
|
||||
{
|
||||
static ETL_CONSTANT bool value = __is_constructible(T, TArgs...);
|
||||
};
|
||||
|
||||
template<typename T, typename... TArgs>
|
||||
ETL_CONSTANT bool is_constructible<T, TArgs...>::value;
|
||||
#else
|
||||
//*********************************************
|
||||
// is_constructible
|
||||
@ -1769,9 +1720,6 @@ namespace etl
|
||||
{
|
||||
static ETL_CONSTANT bool value = __is_constructible(T);
|
||||
};
|
||||
|
||||
template<typename T, typename TArgs>
|
||||
ETL_CONSTANT bool is_constructible<T, TArgs>::value;
|
||||
#endif
|
||||
|
||||
//*********************************************
|
||||
@ -1800,8 +1748,6 @@ namespace etl
|
||||
static ETL_CONSTANT bool value = __is_trivially_constructible(T, TArgs...);
|
||||
#endif
|
||||
};
|
||||
template <typename T, typename... TArgs>
|
||||
ETL_CONSTANT bool is_trivially_constructible<T, TArgs...>::value;
|
||||
#else
|
||||
//*********************************************
|
||||
// is_trivially_constructible
|
||||
@ -1828,9 +1774,6 @@ namespace etl
|
||||
};
|
||||
#endif
|
||||
|
||||
template <typename T, typename TArgs>
|
||||
ETL_CONSTANT bool is_trivially_constructible<T, TArgs>::value;
|
||||
|
||||
//*********************************************
|
||||
// is_trivially_copy_constructible
|
||||
template <typename T>
|
||||
|
||||
@ -214,6 +214,9 @@ namespace etl
|
||||
|
||||
unsigned char storage[Size];
|
||||
};
|
||||
|
||||
template <size_t Size_>
|
||||
ETL_CONSTANT size_t unaligned_type_common<Size_>::Size;
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
@ -599,6 +602,12 @@ namespace etl
|
||||
};
|
||||
};
|
||||
|
||||
template <typename T, int Endian_>
|
||||
ETL_CONSTANT int unaligned_type<T, Endian_>::Endian;
|
||||
|
||||
template <typename T, int Endian_>
|
||||
ETL_CONSTANT size_t unaligned_type<T, Endian_>::Size;
|
||||
|
||||
#if ETL_HAS_CONSTEXPR_ENDIANNESS
|
||||
// Host order
|
||||
typedef unaligned_type<char, etl::endianness::value()> host_char_t;
|
||||
|
||||
@ -18,9 +18,9 @@
|
||||
|
||||
namespace UnitTest
|
||||
{
|
||||
template <typename TChar>
|
||||
typename std::enable_if<!std::is_pointer<TChar>::value, std::string>::type
|
||||
DisplayValue(const TChar& c)
|
||||
template <typename T>
|
||||
typename std::enable_if<!std::is_pointer<T>::value, std::string>::type
|
||||
DisplayValue(const T& c)
|
||||
{
|
||||
std::ostringstream oss;
|
||||
|
||||
@ -93,8 +93,8 @@ namespace UnitTest
|
||||
}
|
||||
#endif
|
||||
|
||||
template <typename TChar>
|
||||
std::string DisplayValue(const TChar* c)
|
||||
template <typename T>
|
||||
std::string DisplayValue(const T* c)
|
||||
{
|
||||
std::ostringstream oss;
|
||||
|
||||
@ -170,7 +170,7 @@ namespace UnitTest
|
||||
}
|
||||
|
||||
template< typename Expected, typename Actual >
|
||||
void CheckEqual(TestResults& results, Expected const& expected, Actual const& actual, TestDetails const& details)
|
||||
void CheckEqual(TestResults& results, Expected&& expected, Actual&& actual, TestDetails const& details)
|
||||
{
|
||||
if (!(expected == actual))
|
||||
{
|
||||
|
||||
@ -30,6 +30,26 @@ if (ETL_OPTIMISATION MATCHES "-O3")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
|
||||
endif()
|
||||
|
||||
if (ETL_CXX_STANDARD MATCHES "98")
|
||||
message(STATUS "Compiling for C++98")
|
||||
set_property(TARGET etl_tests PROPERTY CXX_STANDARD 98)
|
||||
elseif (ETL_CXX_STANDARD MATCHES "03")
|
||||
message(STATUS "Compiling for C++98")
|
||||
set_property(TARGET etl_tests PROPERTY CXX_STANDARD 98)
|
||||
elseif (ETL_CXX_STANDARD MATCHES "11")
|
||||
message(STATUS "Compiling for C++11")
|
||||
set_property(TARGET etl_tests PROPERTY CXX_STANDARD 11)
|
||||
elseif (ETL_CXX_STANDARD MATCHES "14")
|
||||
message(STATUS "Compiling for C++14")
|
||||
set_property(TARGET etl_tests PROPERTY CXX_STANDARD 14)
|
||||
elseif (ETL_CXX_STANDARD MATCHES "17")
|
||||
message(STATUS "Compiling for C++17")
|
||||
set_property(TARGET etl_tests PROPERTY CXX_STANDARD 17)
|
||||
else()
|
||||
message(STATUS "Compiling for C++20")
|
||||
set_property(TARGET etl_tests PROPERTY CXX_STANDARD 20)
|
||||
endif()
|
||||
|
||||
target_include_directories(etl_tests
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_LIST_DIR}
|
||||
@ -59,6 +79,3 @@ add_test(etl_initializer_list_unit_tests etl_tests)
|
||||
add_custom_target(test_verbose COMMAND ${CMAKE_CTEST_COMMAND} --verbose)
|
||||
|
||||
|
||||
#RSG
|
||||
set_property(TARGET etl_tests PROPERTY CXX_STANDARD 17)
|
||||
|
||||
|
||||
@ -1,238 +0,0 @@
|
||||
#!/bin/sh
|
||||
clear
|
||||
|
||||
mkdir -p build-make || exit 1
|
||||
cd build-make || exit 1
|
||||
|
||||
echo "ETL Tests" > log.txt
|
||||
|
||||
opt="-O1"
|
||||
|
||||
#******************************************************************************
|
||||
# GCC
|
||||
#******************************************************************************
|
||||
echo ""
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
echo " GCC - STL" | tee -a log.txt
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
rm * -rf
|
||||
gcc --version | grep gcc | tee -a log.txt
|
||||
cmake -DCMAKE_CXX_COMPILER="g++" -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF -DETL_OPTIMISATION=$opt ..
|
||||
make -j4
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Compilation >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Tests >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
echo " GCC - Initializer list test" | tee -a log.txt
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
cd ../etl_initializer_list/
|
||||
mkdir -p build-make || exit 1
|
||||
cd build-make || exit 1
|
||||
rm * -rf
|
||||
gcc --version | grep gcc | tee -a log.txt
|
||||
cmake -DCMAKE_CXX_COMPILER="g++" -DETL_OPTIMISATION=$opt ..
|
||||
make -j4
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed initializer_list Compilation >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed initializer_list ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Tests >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
echo " Clang - Initializer list test" | tee -a log.txt
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
rm * -rf
|
||||
clang --version | grep clang | tee -a log.txt
|
||||
cmake -DCMAKE_CXX_COMPILER="clang++" -DETL_OPTIMISATION=$opt ..
|
||||
make -j4
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed initializer_list Compilation >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed initializer_list ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Tests >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
echo " GCC - Error macros 'log_errors' test" | tee -a log.txt
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
cd ../../etl_error_handler/log_errors
|
||||
mkdir -p build-make || exit 1
|
||||
cd build-make || exit 1
|
||||
rm * -rf
|
||||
gcc --version | grep gcc | tee -a log.txt
|
||||
cmake -DCMAKE_CXX_COMPILER="g++" -DETL_OPTIMISATION=$opt ..
|
||||
make -j4
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Error macros 'log_errors' Compilation >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed Error macros 'log_errors' ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Tests >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed Error macros 'log_errors' ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
echo " GCC - Error macros 'exceptions' test" | tee -a log.txt
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
cd ../../../etl_error_handler/exceptions
|
||||
mkdir -p build-make || exit 1
|
||||
cd build-make || exit 1
|
||||
rm * -rf
|
||||
gcc --version | grep gcc | tee -a log.txt
|
||||
cmake -DCMAKE_CXX_COMPILER="g++" -DETL_OPTIMISATION=$opt ..
|
||||
make -j4
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Error macros 'exceptions' Compilation >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed Error macros 'exceptions' ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Tests >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed Error macros 'exceptions' ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
echo " GCC - Error macros 'log_errors and exceptions' test" | tee -a log.txt
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
cd ../../../etl_error_handler/log_errors_and_exceptions
|
||||
mkdir -p build-make || exit 1
|
||||
cd build-make || exit 1
|
||||
rm * -rf
|
||||
gcc --version | grep gcc | tee -a log.txt
|
||||
cmake -DCMAKE_CXX_COMPILER="g++" -DETL_OPTIMISATION=$opt ..
|
||||
make -j4
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Error macros 'log_errors and exceptions' Compilation >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed Error macros 'log_errors and exceptions' ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Tests >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed Error macros 'log_errors and exceptions' ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
echo " Clang - Error macros 'log_errors' test" | tee -a log.txt
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
cd ../../../etl_error_handler/log_errors
|
||||
mkdir -p build-make || exit 1
|
||||
cd build-make || exit 1
|
||||
rm * -rf
|
||||
clang --version | grep clang | tee -a log.txt
|
||||
cmake -DCMAKE_CXX_COMPILER="clang++" -DETL_OPTIMISATION=$opt ..
|
||||
make -j4
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Error macros 'log_errors' Compilation >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed Error macros 'log_errors' ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Tests >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed Error macros 'log_errors' ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
echo " Clang - Error macros 'exceptions' test" | tee -a log.txt
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
cd ../../../etl_error_handler/exceptions
|
||||
mkdir -p build-make || exit 1
|
||||
cd build-make || exit 1
|
||||
rm * -rf
|
||||
clang --version | grep clang | tee -a log.txt
|
||||
cmake -DCMAKE_CXX_COMPILER="clang++" -DETL_OPTIMISATION=$opt ..
|
||||
make -j4
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Error macros 'exceptions' Compilation >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed Error macros 'exceptions' ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Tests >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed Error macros 'exceptions' ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
echo " Clang - Error macros 'log_errors and exceptions' test" | tee -a log.txt
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
cd ../../../etl_error_handler/log_errors_and_exceptions
|
||||
mkdir -p build-make || exit 1
|
||||
cd build-make || exit 1
|
||||
rm * -rf
|
||||
clang --version | grep clang | tee -a log.txt
|
||||
cmake -DCMAKE_CXX_COMPILER="clang++" -DETL_OPTIMISATION=$opt ..
|
||||
make -j4
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Error macros 'log_errors and exceptions' Compilation >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed Error macros 'log_errors and exceptions' ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Tests >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed Error macros 'log_errors and exceptions' ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
|
||||
cd ../..
|
||||
|
||||
echo ""
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
echo " All Tests Completed OK" | tee -a log.txt
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
@ -1,238 +0,0 @@
|
||||
#!/bin/sh
|
||||
clear
|
||||
|
||||
mkdir -p build-make || exit 1
|
||||
cd build-make || exit 1
|
||||
|
||||
echo "ETL Tests" > log.txt
|
||||
|
||||
opt="-O2"
|
||||
|
||||
#******************************************************************************
|
||||
# GCC
|
||||
#******************************************************************************
|
||||
echo ""
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
echo " GCC - STL" | tee -a log.txt
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
rm * -rf
|
||||
gcc --version | grep gcc | tee -a log.txt
|
||||
cmake -DCMAKE_CXX_COMPILER="g++" -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF -DETL_OPTIMISATION=$opt ..
|
||||
make -j4
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Compilation >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Tests >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
echo " GCC - Initializer list test" | tee -a log.txt
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
cd ../etl_initializer_list/
|
||||
mkdir -p build-make || exit 1
|
||||
cd build-make || exit 1
|
||||
rm * -rf
|
||||
gcc --version | grep gcc | tee -a log.txt
|
||||
cmake -DCMAKE_CXX_COMPILER="g++" -DETL_OPTIMISATION=$opt ..
|
||||
make -j4
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed initializer_list Compilation >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed initializer_list ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Tests >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
echo " Clang - Initializer list test" | tee -a log.txt
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
rm * -rf
|
||||
clang --version | grep clang | tee -a log.txt
|
||||
cmake -DCMAKE_CXX_COMPILER="clang++" -DETL_OPTIMISATION=$opt ..
|
||||
make -j4
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed initializer_list Compilation >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed initializer_list ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Tests >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
echo " GCC - Error macros 'log_errors' test" | tee -a log.txt
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
cd ../../etl_error_handler/log_errors
|
||||
mkdir -p build-make || exit 1
|
||||
cd build-make || exit 1
|
||||
rm * -rf
|
||||
gcc --version | grep gcc | tee -a log.txt
|
||||
cmake -DCMAKE_CXX_COMPILER="g++" -DETL_OPTIMISATION=$opt ..
|
||||
make -j4
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Error macros 'log_errors' Compilation >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed Error macros 'log_errors' ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Tests >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed Error macros 'log_errors' ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
echo " GCC - Error macros 'exceptions' test" | tee -a log.txt
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
cd ../../../etl_error_handler/exceptions
|
||||
mkdir -p build-make || exit 1
|
||||
cd build-make || exit 1
|
||||
rm * -rf
|
||||
gcc --version | grep gcc | tee -a log.txt
|
||||
cmake -DCMAKE_CXX_COMPILER="g++" -DETL_OPTIMISATION=$opt ..
|
||||
make -j4
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Error macros 'exceptions' Compilation >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed Error macros 'exceptions' ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Tests >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed Error macros 'exceptions' ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
echo " GCC - Error macros 'log_errors and exceptions' test" | tee -a log.txt
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
cd ../../../etl_error_handler/log_errors_and_exceptions
|
||||
mkdir -p build-make || exit 1
|
||||
cd build-make || exit 1
|
||||
rm * -rf
|
||||
gcc --version | grep gcc | tee -a log.txt
|
||||
cmake -DCMAKE_CXX_COMPILER="g++" -DETL_OPTIMISATION=$opt ..
|
||||
make -j4
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Error macros 'log_errors and exceptions' Compilation >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed Error macros 'log_errors and exceptions' ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Tests >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed Error macros 'log_errors and exceptions' ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
echo " Clang - Error macros 'log_errors' test" | tee -a log.txt
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
cd ../../../etl_error_handler/log_errors
|
||||
mkdir -p build-make || exit 1
|
||||
cd build-make || exit 1
|
||||
rm * -rf
|
||||
clang --version | grep clang | tee -a log.txt
|
||||
cmake -DCMAKE_CXX_COMPILER="clang++" -DETL_OPTIMISATION=$opt ..
|
||||
make -j4
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Error macros 'log_errors' Compilation >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed Error macros 'log_errors' ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Tests >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed Error macros 'log_errors' ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
echo " Clang - Error macros 'exceptions' test" | tee -a log.txt
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
cd ../../../etl_error_handler/exceptions
|
||||
mkdir -p build-make || exit 1
|
||||
cd build-make || exit 1
|
||||
rm * -rf
|
||||
clang --version | grep clang | tee -a log.txt
|
||||
cmake -DCMAKE_CXX_COMPILER="clang++" -DETL_OPTIMISATION=$opt ..
|
||||
make -j4
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Error macros 'exceptions' Compilation >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed Error macros 'exceptions' ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Tests >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed Error macros 'exceptions' ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
echo " Clang - Error macros 'log_errors and exceptions' test" | tee -a log.txt
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
cd ../../../etl_error_handler/log_errors_and_exceptions
|
||||
mkdir -p build-make || exit 1
|
||||
cd build-make || exit 1
|
||||
rm * -rf
|
||||
clang --version | grep clang | tee -a log.txt
|
||||
cmake -DCMAKE_CXX_COMPILER="clang++" -DETL_OPTIMISATION=$opt ..
|
||||
make -j4
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Error macros 'log_errors and exceptions' Compilation >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed Error macros 'log_errors and exceptions' ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Tests >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed Error macros 'log_errors and exceptions' ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
|
||||
cd ../..
|
||||
|
||||
echo ""
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
echo " All Tests Completed OK" | tee -a log.txt
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
@ -1,238 +0,0 @@
|
||||
#!/bin/sh
|
||||
clear
|
||||
|
||||
mkdir -p build-make || exit 1
|
||||
cd build-make || exit 1
|
||||
|
||||
echo "ETL Tests" > log.txt
|
||||
|
||||
opt="-O3"
|
||||
|
||||
#******************************************************************************
|
||||
# GCC
|
||||
#******************************************************************************
|
||||
echo ""
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
echo " GCC - STL" | tee -a log.txt
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
rm * -rf
|
||||
gcc --version | grep gcc | tee -a log.txt
|
||||
cmake -DCMAKE_CXX_COMPILER="g++" -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF -DETL_OPTIMISATION=$opt ..
|
||||
make -j4
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Compilation >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Tests >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
echo " GCC - Initializer list test" | tee -a log.txt
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
cd ../etl_initializer_list/
|
||||
mkdir -p build-make || exit 1
|
||||
cd build-make || exit 1
|
||||
rm * -rf
|
||||
gcc --version | grep gcc | tee -a log.txt
|
||||
cmake -DCMAKE_CXX_COMPILER="g++" -DETL_OPTIMISATION=$opt ..
|
||||
make -j4
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed initializer_list Compilation >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed initializer_list ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Tests >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
echo " Clang - Initializer list test" | tee -a log.txt
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
rm * -rf
|
||||
clang --version | grep clang | tee -a log.txt
|
||||
cmake -DCMAKE_CXX_COMPILER="clang++" -DETL_OPTIMISATION=$opt ..
|
||||
make -j4
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed initializer_list Compilation >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed initializer_list ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Tests >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
echo " GCC - Error macros 'log_errors' test" | tee -a log.txt
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
cd ../../etl_error_handler/log_errors
|
||||
mkdir -p build-make || exit 1
|
||||
cd build-make || exit 1
|
||||
rm * -rf
|
||||
gcc --version | grep gcc | tee -a log.txt
|
||||
cmake -DCMAKE_CXX_COMPILER="g++" -DETL_OPTIMISATION=$opt ..
|
||||
make -j4
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Error macros 'log_errors' Compilation >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed Error macros 'log_errors' ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Tests >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed Error macros 'log_errors' ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
echo " GCC - Error macros 'exceptions' test" | tee -a log.txt
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
cd ../../../etl_error_handler/exceptions
|
||||
mkdir -p build-make || exit 1
|
||||
cd build-make || exit 1
|
||||
rm * -rf
|
||||
gcc --version | grep gcc | tee -a log.txt
|
||||
cmake -DCMAKE_CXX_COMPILER="g++" -DETL_OPTIMISATION=$opt ..
|
||||
make -j4
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Error macros 'exceptions' Compilation >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed Error macros 'exceptions' ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Tests >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed Error macros 'exceptions' ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
echo " GCC - Error macros 'log_errors and exceptions' test" | tee -a log.txt
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
cd ../../../etl_error_handler/log_errors_and_exceptions
|
||||
mkdir -p build-make || exit 1
|
||||
cd build-make || exit 1
|
||||
rm * -rf
|
||||
gcc --version | grep gcc | tee -a log.txt
|
||||
cmake -DCMAKE_CXX_COMPILER="g++" -DETL_OPTIMISATION=$opt ..
|
||||
make -j4
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Error macros 'log_errors and exceptions' Compilation >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed Error macros 'log_errors and exceptions' ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Tests >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed Error macros 'log_errors and exceptions' ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
echo " Clang - Error macros 'log_errors' test" | tee -a log.txt
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
cd ../../../etl_error_handler/log_errors
|
||||
mkdir -p build-make || exit 1
|
||||
cd build-make || exit 1
|
||||
rm * -rf
|
||||
clang --version | grep clang | tee -a log.txt
|
||||
cmake -DCMAKE_CXX_COMPILER="clang++" -DETL_OPTIMISATION=$opt ..
|
||||
make -j4
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Error macros 'log_errors' Compilation >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed Error macros 'log_errors' ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Tests >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed Error macros 'log_errors' ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
echo " Clang - Error macros 'exceptions' test" | tee -a log.txt
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
cd ../../../etl_error_handler/exceptions
|
||||
mkdir -p build-make || exit 1
|
||||
cd build-make || exit 1
|
||||
rm * -rf
|
||||
clang --version | grep clang | tee -a log.txt
|
||||
cmake -DCMAKE_CXX_COMPILER="clang++" -DETL_OPTIMISATION=$opt ..
|
||||
make -j4
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Error macros 'exceptions' Compilation >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed Error macros 'exceptions' ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Tests >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed Error macros 'exceptions' ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
echo " Clang - Error macros 'log_errors and exceptions' test" | tee -a log.txt
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
cd ../../../etl_error_handler/log_errors_and_exceptions
|
||||
mkdir -p build-make || exit 1
|
||||
cd build-make || exit 1
|
||||
rm * -rf
|
||||
clang --version | grep clang | tee -a log.txt
|
||||
cmake -DCMAKE_CXX_COMPILER="clang++" -DETL_OPTIMISATION=$opt ..
|
||||
make -j4
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Error macros 'log_errors and exceptions' Compilation >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed Error macros 'log_errors and exceptions' ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Tests >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed Error macros 'log_errors and exceptions' ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
|
||||
cd ../..
|
||||
|
||||
echo ""
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
echo " All Tests Completed OK" | tee -a log.txt
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
@ -1,348 +0,0 @@
|
||||
#!/bin/sh
|
||||
clear
|
||||
|
||||
mkdir -p build-make || exit 1
|
||||
cd build-make || exit 1
|
||||
|
||||
echo "ETL Tests" > log.txt
|
||||
|
||||
opt="-O0"
|
||||
cxx_standard="14"
|
||||
|
||||
#******************************************************************************
|
||||
# GCC
|
||||
#******************************************************************************
|
||||
echo ""
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
echo " GCC - STL" | tee -a log.txt
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
rm * -rf
|
||||
gcc --version | grep gcc | tee -a log.txt
|
||||
cmake -DCMAKE_CXX_COMPILER="g++" -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard ..
|
||||
make -j4
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Compilation >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Tests >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
echo ""
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
echo " GCC - STL - Force C++03" | tee -a log.txt
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
rm * -rf
|
||||
gcc --version | grep gcc | tee -a log.txt
|
||||
cmake -DCMAKE_CXX_COMPILER="g++" -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=ON -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard ..
|
||||
make -j4
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Compilation >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Tests >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
echo ""
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
echo " GCC - No STL" | tee -a log.txt
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
rm * -rf
|
||||
gcc --version | grep gcc | tee -a log.txt
|
||||
cmake -DCMAKE_CXX_COMPILER="g++" -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard ..
|
||||
make -j4
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Compilation >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Tests >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
|
||||
#******************************************************************************
|
||||
# CLANG
|
||||
#******************************************************************************
|
||||
echo ""
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
echo " Clang - STL" | tee -a log.txt
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
rm * -rf
|
||||
clang --version | grep clang | tee -a log.txt
|
||||
cmake -DCMAKE_CXX_COMPILER="clang++" -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard ..
|
||||
make -j4
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Compilation >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Tests >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
echo ""
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
echo " Clang - STL - Force C++03" | tee -a log.txt
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
rm * -rf
|
||||
clang --version | grep clang | tee -a log.txt
|
||||
cmake -DCMAKE_CXX_COMPILER="clang++" -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=ON -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard ..
|
||||
make -j4
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Compilation >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Tests >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
echo ""
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
echo " Clang - No STL" | tee -a log.txt
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
rm * -rf
|
||||
clang --version | grep clang | tee -a log.txt
|
||||
cmake -DCMAKE_CXX_COMPILER="clang++" -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard ..
|
||||
make -j4
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Compilation >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Tests >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
echo " GCC - Initializer list test" | tee -a log.txt
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
cd ../etl_initializer_list/
|
||||
mkdir -p build-make || exit 1
|
||||
cd build-make || exit 1
|
||||
rm * -rf
|
||||
gcc --version | grep gcc | tee -a log.txt
|
||||
cmake -DCMAKE_CXX_COMPILER="g++" -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard ..
|
||||
make -j4
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed initializer_list Compilation >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed initializer_list ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Tests >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
echo " Clang - Initializer list test" | tee -a log.txt
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
rm * -rf
|
||||
clang --version | grep clang | tee -a log.txt
|
||||
cmake -DCMAKE_CXX_COMPILER="clang++" -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard ..
|
||||
make -j4
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed initializer_list Compilation >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed initializer_list ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Tests >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
echo " GCC - Error macros 'log_errors' test" | tee -a log.txt
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
cd ../../etl_error_handler/log_errors
|
||||
mkdir -p build-make || exit 1
|
||||
cd build-make || exit 1
|
||||
rm * -rf
|
||||
gcc --version | grep gcc | tee -a log.txt
|
||||
cmake -DCMAKE_CXX_COMPILER="g++" -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard ..
|
||||
make -j4
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Error macros 'log_errors' Compilation >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed Error macros 'log_errors' ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Tests >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed Error macros 'log_errors' ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
echo " GCC - Error macros 'exceptions' test" | tee -a log.txt
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
cd ../../../etl_error_handler/exceptions
|
||||
mkdir -p build-make || exit 1
|
||||
cd build-make || exit 1
|
||||
rm * -rf
|
||||
gcc --version | grep gcc | tee -a log.txt
|
||||
cmake -DCMAKE_CXX_COMPILER="g++" -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard ..
|
||||
make -j4
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Error macros 'exceptions' Compilation >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed Error macros 'exceptions' ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Tests >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed Error macros 'exceptions' ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
echo " GCC - Error macros 'log_errors and exceptions' test" | tee -a log.txt
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
cd ../../../etl_error_handler/log_errors_and_exceptions
|
||||
mkdir -p build-make || exit 1
|
||||
cd build-make || exit 1
|
||||
rm * -rf
|
||||
gcc --version | grep gcc | tee -a log.txt
|
||||
cmake -DCMAKE_CXX_COMPILER="g++" -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard ..
|
||||
make -j4
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Error macros 'log_errors and exceptions' Compilation >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed Error macros 'log_errors and exceptions' ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Tests >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed Error macros 'log_errors and exceptions' ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
echo " Clang - Error macros 'log_errors' test" | tee -a log.txt
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
cd ../../../etl_error_handler/log_errors
|
||||
mkdir -p build-make || exit 1
|
||||
cd build-make || exit 1
|
||||
rm * -rf
|
||||
clang --version | grep clang | tee -a log.txt
|
||||
cmake -DCMAKE_CXX_COMPILER="clang++" -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard ..
|
||||
make -j4
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Error macros 'log_errors' Compilation >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed Error macros 'log_errors' ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Tests >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed Error macros 'log_errors' ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
echo " Clang - Error macros 'exceptions' test" | tee -a log.txt
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
cd ../../../etl_error_handler/exceptions
|
||||
mkdir -p build-make || exit 1
|
||||
cd build-make || exit 1
|
||||
rm * -rf
|
||||
clang --version | grep clang | tee -a log.txt
|
||||
cmake -DCMAKE_CXX_COMPILER="clang++" -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard ..
|
||||
make -j4
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Error macros 'exceptions' Compilation >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed Error macros 'exceptions' ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Tests >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed Error macros 'exceptions' ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
echo " Clang - Error macros 'log_errors and exceptions' test" | tee -a log.txt
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
cd ../../../etl_error_handler/log_errors_and_exceptions
|
||||
mkdir -p build-make || exit 1
|
||||
cd build-make || exit 1
|
||||
rm * -rf
|
||||
clang --version | grep clang | tee -a log.txt
|
||||
cmake -DCMAKE_CXX_COMPILER="clang++" -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard ..
|
||||
make -j4
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Error macros 'log_errors and exceptions' Compilation >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed Error macros 'log_errors and exceptions' ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Tests >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed Error macros 'log_errors and exceptions' ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
|
||||
cd ../..
|
||||
|
||||
echo ""
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
echo " All Tests Completed OK" | tee -a log.txt
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
464
test/runtests.sh
464
test/runtests.sh
@ -6,365 +6,413 @@ cd build-make || exit 1
|
||||
|
||||
echo "ETL Tests" > log.txt
|
||||
|
||||
# Set the optimisation level
|
||||
if [ "$1" = "1" ]; then
|
||||
# Set the language standard. Default C++20
|
||||
if [ "$1" = "11" ]; then
|
||||
cxx_standard="11"
|
||||
elif [ "$1" = "14" ]; then
|
||||
cxx_standard="14"
|
||||
elif [ "$1" = "17" ]; then
|
||||
cxx_standard="17"
|
||||
else
|
||||
cxx_standard="20"
|
||||
fi
|
||||
|
||||
# Set the optimisation level. Default -O0
|
||||
if [ "$2" = "1" ]; then
|
||||
opt="-O1"
|
||||
elif [ "$1" = "2" ]; then
|
||||
elif [ "$2" = "2" ]; then
|
||||
opt="-O2"
|
||||
elif [ "$1" = "3" ]; then
|
||||
elif [ "$2" = "3" ]; then
|
||||
opt="-O3"
|
||||
else
|
||||
opt="-O0"
|
||||
fi
|
||||
|
||||
testname="Test Name Not Set"
|
||||
|
||||
FailColour='\033[38;2;255;128;128m'
|
||||
PassColour='\033[38;2;128;255;128m'
|
||||
TitleColour='\033[38;2;100;173;254m'
|
||||
NoColour='\033[0m'
|
||||
|
||||
echo -e
|
||||
|
||||
TestName()
|
||||
{
|
||||
testname=$1
|
||||
}
|
||||
|
||||
PrintHeader()
|
||||
{
|
||||
echo "${TitleColour}"
|
||||
echo "----------------------------------------------------------------------------" | tee -a log.txt
|
||||
echo " $testname" | tee -a log.txt
|
||||
echo " Language standard : C++${cxx_standard}"
|
||||
echo " Optimisation : ${opt}"
|
||||
echo "----------------------------------------------------------------------------" | tee -a log.txt
|
||||
echo "${NoColour}"
|
||||
}
|
||||
|
||||
PassedCompilation()
|
||||
{
|
||||
echo "${PassColour}"
|
||||
echo "<<<< Passed Compilation - $testname >>>>" | tee -a ../log.txt
|
||||
echo "${NoColour}"
|
||||
}
|
||||
|
||||
PassedTests()
|
||||
{
|
||||
echo "${PassColour}"
|
||||
echo "<<<< Passed Tests - $testname >>>>" | tee -a ../log.txt
|
||||
echo "${NoColour}"
|
||||
}
|
||||
|
||||
FailedCompilation()
|
||||
{
|
||||
echo "${FailColour}"
|
||||
echo "****************************************************************************" | tee -a log.txt
|
||||
echo "**** Failed Compilation $testname" | tee -a log.txt
|
||||
echo "****************************************************************************" | tee -a ../log.txt
|
||||
echo "${NoColour}"
|
||||
}
|
||||
|
||||
FailedTests()
|
||||
{
|
||||
echo "${FailColour}"
|
||||
echo "****************************************************************************" | tee -a log.txt
|
||||
echo "**** Failed Tests $testname" | tee -a log.txt
|
||||
echo "****************************************************************************" | tee -a ../log.txt
|
||||
echo "${NoColour}"
|
||||
}
|
||||
|
||||
TestsCompleted()
|
||||
{
|
||||
echo "${PassColour}"
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
echo " All Tests Completed OK" | tee -a log.txt
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
echo "${NoColour}"
|
||||
}
|
||||
|
||||
#******************************************************************************
|
||||
# GCC
|
||||
#******************************************************************************
|
||||
echo ""
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
echo " GCC - STL" | tee -a log.txt
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
rm * -rf
|
||||
gcc --version | grep gcc | tee -a log.txt
|
||||
echo "Using optimisation" $opt | tee -a log.txt
|
||||
cmake -DCMAKE_CXX_COMPILER="g++" -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF -DETL_OPTIMISATION=$opt ..
|
||||
make -j4
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Compilation >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Tests >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
echo ""
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
echo " GCC - STL - Force C++03" | tee -a log.txt
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
rm * -rf
|
||||
gcc --version | grep gcc | tee -a log.txt
|
||||
echo "Using optimisation" $opt | tee -a log.txt
|
||||
cmake -DCMAKE_CXX_COMPILER="g++" -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=ON -DETL_OPTIMISATION=$opt ..
|
||||
make -j4
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Compilation >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Tests >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
echo ""
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
echo " GCC - No STL" | tee -a log.txt
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
rm * -rf
|
||||
gcc --version | grep gcc | tee -a log.txt
|
||||
echo "Using optimisation" $opt | tee -a log.txt
|
||||
cmake -DCMAKE_CXX_COMPILER="g++" -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF -DETL_OPTIMISATION=$opt ..
|
||||
make -j4
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Compilation >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Tests >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
#TestName "GCC - STL"
|
||||
#PrintHeader
|
||||
#rm * -rf
|
||||
#gcc --version | grep gcc | tee -a log.txt
|
||||
#cmake -DCMAKE_CXX_COMPILER="g++" -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard ..
|
||||
#make -j4
|
||||
#if [ $? -eq 0 ]; then
|
||||
# PassedCompilation
|
||||
#else
|
||||
# FailedCompilation
|
||||
# exit $?
|
||||
#fi
|
||||
#./etl_tests
|
||||
#if [ $? -eq 0 ]; then
|
||||
# PassedTests
|
||||
#else
|
||||
# FailedTests
|
||||
# exit $?
|
||||
#fi
|
||||
|
||||
#******************************************************************************
|
||||
#TestName "GCC - STL - Force C++03"
|
||||
#PrintHeader
|
||||
#rm * -rf
|
||||
#gcc --version | grep gcc | tee -a log.txt
|
||||
#cmake -DCMAKE_CXX_COMPILER="g++" -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=ON -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard ..
|
||||
#make -j4
|
||||
#if [ $? -eq 0 ]; then
|
||||
# PassedCompilation
|
||||
#else
|
||||
# FailedCompilation
|
||||
# exit $?
|
||||
#fi
|
||||
#./etl_tests
|
||||
#if [ $? -eq 0 ]; then
|
||||
# PassedTests
|
||||
#else
|
||||
# FailedTests
|
||||
# exit $?
|
||||
#fi
|
||||
|
||||
#******************************************************************************
|
||||
#TestName "GCC - No STL"
|
||||
#PrintHeader
|
||||
#rm * -rf
|
||||
#gcc --version | grep gcc | tee -a log.txt
|
||||
#cmake -DCMAKE_CXX_COMPILER="g++" -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard ..
|
||||
#make -j4
|
||||
#if [ $? -eq 0 ]; then
|
||||
# PassedCompilation
|
||||
#else
|
||||
# FailedCompilation
|
||||
# exit $?
|
||||
#fi
|
||||
#./etl_tests
|
||||
#if [ $? -eq 0 ]; then
|
||||
# PassedTests
|
||||
#else
|
||||
# FailedTests
|
||||
# exit $?
|
||||
#fi
|
||||
|
||||
#******************************************************************************
|
||||
# CLANG
|
||||
#******************************************************************************
|
||||
echo ""
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
echo " Clang - STL" | tee -a log.txt
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
TestName "Clang - STL"
|
||||
PrintHeader
|
||||
rm * -rf
|
||||
clang --version | grep clang | tee -a log.txt
|
||||
echo "Using optimisation" $opt | tee -a log.txt
|
||||
cmake -DCMAKE_CXX_COMPILER="clang++" -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF -DETL_OPTIMISATION=$opt ..
|
||||
cmake -DCMAKE_CXX_COMPILER="clang++" -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard ..
|
||||
make -j4
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Compilation >>>>"
|
||||
PassedCompilation
|
||||
else
|
||||
echo "****************\n**** Failed ****\n****************" | tee -a ../log.txt
|
||||
FailedCompilation
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Tests >>>>"
|
||||
PassedTests
|
||||
else
|
||||
echo "****************\n**** Failed ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
echo ""
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
echo " Clang - STL - Force C++03" | tee -a log.txt
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
rm * -rf
|
||||
clang --version | grep clang | tee -a log.txt
|
||||
echo "Using optimisation" $opt | tee -a log.txt
|
||||
cmake -DCMAKE_CXX_COMPILER="clang++" -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=ON -DETL_OPTIMISATION=$opt ..
|
||||
make -j4
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Compilation >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Tests >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
echo ""
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
echo " Clang - No STL" | tee -a log.txt
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
rm * -rf
|
||||
clang --version | grep clang | tee -a log.txt
|
||||
echo "Using optimisation" $opt | tee -a log.txt
|
||||
cmake -DCMAKE_CXX_COMPILER="clang++" -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF -DETL_OPTIMISATION=$opt ..
|
||||
make -j4
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Compilation >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed ****\n****************" | tee -a ../log.txt
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Tests >>>>"
|
||||
else
|
||||
echo "****************\n**** Failed ****\n****************" | tee -a ../log.txt
|
||||
FailedTests
|
||||
exit $?
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
echo " GCC - Initializer list test" | tee -a log.txt
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
#******************************************************************************
|
||||
TestName "Clang - STL - Force C++03"
|
||||
PrintHeader
|
||||
rm * -rf
|
||||
clang --version | grep clang | tee -a log.txt
|
||||
cmake -DCMAKE_CXX_COMPILER="clang++" -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=ON -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard ..
|
||||
make -j4
|
||||
if [ $? -eq 0 ]; then
|
||||
PassedCompilation
|
||||
else
|
||||
FailedCompilation
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests
|
||||
if [ $? -eq 0 ]; then
|
||||
PassedTests
|
||||
else
|
||||
FailedTests
|
||||
exit $?
|
||||
fi
|
||||
|
||||
#******************************************************************************
|
||||
TestName "Clang - No STL"
|
||||
PrintHeader
|
||||
rm * -rf
|
||||
clang --version | grep clang | tee -a log.txt
|
||||
cmake -DCMAKE_CXX_COMPILER="clang++" -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard ..
|
||||
make -j4
|
||||
if [ $? -eq 0 ]; then
|
||||
PassedCompilation
|
||||
else
|
||||
FailedCompilation
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests
|
||||
if [ $? -eq 0 ]; then
|
||||
PassedTests
|
||||
else
|
||||
FailedTests
|
||||
exit $?
|
||||
fi
|
||||
|
||||
#******************************************************************************
|
||||
TestName "GCC - Initializer list test"
|
||||
PrintHeader
|
||||
cd ../etl_initializer_list/
|
||||
mkdir -p build-make || exit 1
|
||||
cd build-make || exit 1
|
||||
rm * -rf
|
||||
gcc --version | grep gcc | tee -a log.txt
|
||||
echo "Using optimisation" $opt | tee -a log.txt
|
||||
cmake -DCMAKE_CXX_COMPILER="g++" -DETL_OPTIMISATION=$opt ..
|
||||
cmake -DCMAKE_CXX_COMPILER="g++" -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard ..
|
||||
make -j4
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed initializer_list Compilation >>>>"
|
||||
PassedCompilation
|
||||
else
|
||||
echo "****************\n**** Failed initializer_list ****\n****************" | tee -a ../log.txt
|
||||
FailedCompilation
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Tests >>>>"
|
||||
PassedTests
|
||||
else
|
||||
echo "****************\n**** Failed ****\n****************" | tee -a ../log.txt
|
||||
FailedTests
|
||||
exit $?
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
echo " Clang - Initializer list test" | tee -a log.txt
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
#******************************************************************************
|
||||
TestName "Clang - Initializer list test"
|
||||
PrintHeader
|
||||
rm * -rf
|
||||
clang --version | grep clang | tee -a log.txt
|
||||
echo "Using optimisation" $opt | tee -a log.txt
|
||||
cmake -DCMAKE_CXX_COMPILER="clang++" -DETL_OPTIMISATION=$opt ..
|
||||
cmake -DCMAKE_CXX_COMPILER="clang++" -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard ..
|
||||
make -j4
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed initializer_list Compilation >>>>"
|
||||
PassedCompilation
|
||||
else
|
||||
echo "****************\n**** Failed initializer_list ****\n****************" | tee -a ../log.txt
|
||||
FailedCompilation
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Tests >>>>"
|
||||
PassedTests
|
||||
else
|
||||
echo "****************\n**** Failed ****\n****************" | tee -a ../log.txt
|
||||
FailedTests
|
||||
exit $?
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
echo " GCC - Error macros 'log_errors' test" | tee -a log.txt
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
#******************************************************************************
|
||||
TestName "GCC - Error macros 'log_errors' test"
|
||||
PrintHeader
|
||||
cd ../../etl_error_handler/log_errors
|
||||
mkdir -p build-make || exit 1
|
||||
cd build-make || exit 1
|
||||
rm * -rf
|
||||
gcc --version | grep gcc | tee -a log.txt
|
||||
echo "Using optimisation" $opt | tee -a log.txt
|
||||
cmake -DCMAKE_CXX_COMPILER="g++" -DETL_OPTIMISATION=$opt ..
|
||||
cmake -DCMAKE_CXX_COMPILER="g++" -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard ..
|
||||
make -j4
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Error macros 'log_errors' Compilation >>>>"
|
||||
PassedCompilation
|
||||
else
|
||||
echo "****************\n**** Failed Error macros 'log_errors' ****\n****************" | tee -a ../log.txt
|
||||
FailedCompilation
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Tests >>>>"
|
||||
PassedTests
|
||||
else
|
||||
echo "****************\n**** Failed Error macros 'log_errors' ****\n****************" | tee -a ../log.txt
|
||||
FailedTests
|
||||
exit $?
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
echo " GCC - Error macros 'exceptions' test" | tee -a log.txt
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
#******************************************************************************
|
||||
TestName "GCC - Error macros 'exceptions' test"
|
||||
PrintHeader
|
||||
cd ../../../etl_error_handler/exceptions
|
||||
mkdir -p build-make || exit 1
|
||||
cd build-make || exit 1
|
||||
rm * -rf
|
||||
gcc --version | grep gcc | tee -a log.txt
|
||||
echo "Using optimisation" $opt | tee -a log.txt
|
||||
cmake -DCMAKE_CXX_COMPILER="g++" -DETL_OPTIMISATION=$opt ..
|
||||
cmake -DCMAKE_CXX_COMPILER="g++" -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard ..
|
||||
make -j4
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Error macros 'exceptions' Compilation >>>>"
|
||||
PassedCompilation
|
||||
else
|
||||
echo "****************\n**** Failed Error macros 'exceptions' ****\n****************" | tee -a ../log.txt
|
||||
FailedCompilation
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Tests >>>>"
|
||||
PassedTests
|
||||
else
|
||||
echo "****************\n**** Failed Error macros 'exceptions' ****\n****************" | tee -a ../log.txt
|
||||
FailedTests
|
||||
exit $?
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
echo " GCC - Error macros 'log_errors and exceptions' test" | tee -a log.txt
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
#******************************************************************************
|
||||
TestName "GCC - Error macros 'log_errors and exceptions' test"
|
||||
PrintHeader
|
||||
cd ../../../etl_error_handler/log_errors_and_exceptions
|
||||
mkdir -p build-make || exit 1
|
||||
cd build-make || exit 1
|
||||
rm * -rf
|
||||
gcc --version | grep gcc | tee -a log.txt
|
||||
echo "Using optimisation" $opt | tee -a log.txt
|
||||
cmake -DCMAKE_CXX_COMPILER="g++" -DETL_OPTIMISATION=$opt ..
|
||||
cmake -DCMAKE_CXX_COMPILER="g++" -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard ..
|
||||
make -j4
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Error macros 'log_errors and exceptions' Compilation >>>>"
|
||||
PassedCompilation
|
||||
else
|
||||
echo "****************\n**** Failed Error macros 'log_errors and exceptions' ****\n****************" | tee -a ../log.txt
|
||||
FailedCompilation
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Tests >>>>"
|
||||
PassedTests
|
||||
else
|
||||
echo "****************\n**** Failed Error macros 'log_errors and exceptions' ****\n****************" | tee -a ../log.txt
|
||||
FailedTests
|
||||
exit $?
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
echo " Clang - Error macros 'log_errors' test" | tee -a log.txt
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
#******************************************************************************
|
||||
TestName "Clang - Error macros 'log_errors' test"
|
||||
PrintHeader
|
||||
cd ../../../etl_error_handler/log_errors
|
||||
mkdir -p build-make || exit 1
|
||||
cd build-make || exit 1
|
||||
rm * -rf
|
||||
clang --version | grep clang | tee -a log.txt
|
||||
echo "Using optimisation" $opt | tee -a log.txt
|
||||
cmake -DCMAKE_CXX_COMPILER="clang++" -DETL_OPTIMISATION=$opt ..
|
||||
cmake -DCMAKE_CXX_COMPILER="clang++" -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard ..
|
||||
make -j4
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Error macros 'log_errors' Compilation >>>>"
|
||||
PassedCompilation
|
||||
else
|
||||
echo "****************\n**** Failed Error macros 'log_errors' ****\n****************" | tee -a ../log.txt
|
||||
FailedCompilation
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Tests >>>>"
|
||||
PassedTests
|
||||
else
|
||||
echo "****************\n**** Failed Error macros 'log_errors' ****\n****************" | tee -a ../log.txt
|
||||
FailedTests
|
||||
exit $?
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
echo " Clang - Error macros 'exceptions' test" | tee -a log.txt
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
#******************************************************************************
|
||||
TestName "Clang - Error macros 'exceptions' test"
|
||||
PrintHeader
|
||||
cd ../../../etl_error_handler/exceptions
|
||||
mkdir -p build-make || exit 1
|
||||
cd build-make || exit 1
|
||||
rm * -rf
|
||||
clang --version | grep clang | tee -a log.txt
|
||||
echo "Using optimisation" $opt | tee -a log.txt
|
||||
cmake -DCMAKE_CXX_COMPILER="clang++" -DETL_OPTIMISATION=$opt ..
|
||||
cmake -DCMAKE_CXX_COMPILER="clang++" -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard ..
|
||||
make -j4
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Error macros 'exceptions' Compilation >>>>"
|
||||
PassedCompilation
|
||||
else
|
||||
echo "****************\n**** Failed Error macros 'exceptions' ****\n****************" | tee -a ../log.txt
|
||||
FailedCompilation
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Tests >>>>"
|
||||
PassedTests
|
||||
else
|
||||
echo "****************\n**** Failed Error macros 'exceptions' ****\n****************" | tee -a ../log.txt
|
||||
FailedTests
|
||||
exit $?
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
echo " Clang - Error macros 'log_errors and exceptions' test" | tee -a log.txt
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
#******************************************************************************
|
||||
TestName "Clang - Error macros 'log_errors and exceptions' test"
|
||||
PrintHeader
|
||||
cd ../../../etl_error_handler/log_errors_and_exceptions
|
||||
mkdir -p build-make || exit 1
|
||||
cd build-make || exit 1
|
||||
rm * -rf
|
||||
clang --version | grep clang | tee -a log.txt
|
||||
echo "Using optimisation" $opt | tee -a log.txt
|
||||
cmake -DCMAKE_CXX_COMPILER="clang++" -DETL_OPTIMISATION=$opt ..
|
||||
cmake -DCMAKE_CXX_COMPILER="clang++" -DETL_OPTIMISATION=$opt -DETL_CXX_STANDARD=$cxx_standard ..
|
||||
make -j4
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Error macros 'log_errors and exceptions' Compilation >>>>"
|
||||
PassedCompilation
|
||||
else
|
||||
echo "****************\n**** Failed Error macros 'log_errors and exceptions' ****\n****************" | tee -a ../log.txt
|
||||
FailedCompilation
|
||||
exit $?
|
||||
fi
|
||||
./etl_tests
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "<<<< Passed Tests >>>>"
|
||||
PassedTests
|
||||
else
|
||||
echo "****************\n**** Failed Error macros 'log_errors and exceptions' ****\n****************" | tee -a ../log.txt
|
||||
FailedTests
|
||||
exit $?
|
||||
fi
|
||||
|
||||
cd ../..
|
||||
|
||||
echo ""
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
echo " All Tests Completed OK" | tee -a log.txt
|
||||
echo "-----------------------------------------------" | tee -a log.txt
|
||||
TestsCompleted
|
||||
|
||||
@ -33,6 +33,7 @@ SOFTWARE.
|
||||
#include "etl/list.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <limits>
|
||||
#include <numeric>
|
||||
#include <vector>
|
||||
#include <deque>
|
||||
|
||||
@ -31,6 +31,7 @@ SOFTWARE.
|
||||
#include <ostream>
|
||||
#include <sstream>
|
||||
#include <iomanip>
|
||||
#include <limits>
|
||||
|
||||
#include "etl/to_arithmetic.h"
|
||||
#include "etl/string.h"
|
||||
|
||||
@ -31,6 +31,7 @@ SOFTWARE.
|
||||
#include <ostream>
|
||||
#include <sstream>
|
||||
#include <iomanip>
|
||||
#include <limits>
|
||||
|
||||
#include "etl/to_arithmetic.h"
|
||||
#include "etl/u16string.h"
|
||||
|
||||
@ -31,6 +31,7 @@ SOFTWARE.
|
||||
#include <ostream>
|
||||
#include <sstream>
|
||||
#include <iomanip>
|
||||
#include <limits>
|
||||
|
||||
#include "etl/to_arithmetic.h"
|
||||
#include "etl/u32string.h"
|
||||
|
||||
@ -31,6 +31,7 @@ SOFTWARE.
|
||||
#include <ostream>
|
||||
#include <sstream>
|
||||
#include <iomanip>
|
||||
#include <limits>
|
||||
|
||||
#include "etl/to_arithmetic.h"
|
||||
#include "etl/wstring.h"
|
||||
|
||||
@ -21,33 +21,16 @@
|
||||
#define ETL_CPP11_SUPPORTED
|
||||
#define ETL_CPP14_SUPPORTED
|
||||
#define ETL_CPP17_SUPPORTED
|
||||
|
||||
#define TEST
|
||||
#define CHECK
|
||||
#define CHECK_EQUAL
|
||||
#define CHECK_THROW
|
||||
// Hint files help the Visual Studio IDE interpret Visual C++ identifiers
|
||||
// such as names of functions and macros.
|
||||
// For more information see https://go.microsoft.com/fwlink/?linkid=865984
|
||||
#define ETL_ASSERT(b, e)
|
||||
#define ETL_ASSERT(b, e) {if (!(b)) {etl::error_handler::error((e)); throw((e));}}
|
||||
#define ETL_ASSERT(b, e) {if (!(b)) {throw((e));}}
|
||||
#define ETL_ASSERT(b, e) {if(!(b)) {etl::error_handler::error((e));}}
|
||||
#define ETL_ASSERT(b, e) assert((b))
|
||||
// Hint files help the Visual Studio IDE interpret Visual C++ identifiers
|
||||
// such as names of functions and macros.
|
||||
// For more information see https://go.microsoft.com/fwlink/?linkid=865984
|
||||
#define ETL_NULLPTR
|
||||
// Hint files help the Visual Studio IDE interpret Visual C++ identifiers
|
||||
// such as names of functions and macros.
|
||||
// For more information see https://go.microsoft.com/fwlink/?linkid=865984
|
||||
#define ETL_NODISCARD [[nodiscard]]
|
||||
#define ETL_NODISCARD
|
||||
// Hint files help the Visual Studio IDE interpret Visual C++ identifiers
|
||||
// such as names of functions and macros.
|
||||
// For more information see https://go.microsoft.com/fwlink/?linkid=865984
|
||||
#define ETL_CONSTEXPR
|
||||
// Hint files help the Visual Studio IDE interpret Visual C++ identifiers
|
||||
// such as names of functions and macros.
|
||||
// For more information see https://go.microsoft.com/fwlink/?linkid=865984
|
||||
#define ETL_NOEXCEPT
|
||||
#define ETL_CONSTANT
|
||||
|
||||
@ -13452,10 +13452,6 @@
|
||||
<None Include="..\..\scripts\update_release.py" />
|
||||
<None Include="..\meson.build" />
|
||||
<None Include="..\runsanitychecks.sh" />
|
||||
<None Include="..\runtests-O1.sh" />
|
||||
<None Include="..\runtests-O2.sh" />
|
||||
<None Include="..\runtests-O3.sh" />
|
||||
<None Include="..\runtests-c++14.sh" />
|
||||
<None Include="..\runtests.sh" />
|
||||
<None Include="cpp.hint" />
|
||||
</ItemGroup>
|
||||
|
||||
@ -3472,9 +3472,6 @@
|
||||
<None Include="..\runsanitychecks.sh">
|
||||
<Filter>Tests\Scripts</Filter>
|
||||
</None>
|
||||
<None Include="..\runtests.sh">
|
||||
<Filter>Tests\Scripts</Filter>
|
||||
</None>
|
||||
<None Include="..\..\.clang-format">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
@ -3514,19 +3511,10 @@
|
||||
<None Include="..\meson.build">
|
||||
<Filter>Tests\Test Support</Filter>
|
||||
</None>
|
||||
<None Include="..\runtests-01.sh">
|
||||
<Filter>Tests\Scripts</Filter>
|
||||
</None>
|
||||
<None Include="..\runtests-03.sh">
|
||||
<Filter>Tests\Scripts</Filter>
|
||||
</None>
|
||||
<None Include="..\runtests-02.sh">
|
||||
<Filter>Tests\Scripts</Filter>
|
||||
</None>
|
||||
<None Include="..\..\.github\workflows\msvc.yml">
|
||||
<Filter>Resource Files\CI\Github</Filter>
|
||||
</None>
|
||||
<None Include="..\runtests-c++14.sh">
|
||||
<None Include="..\runtests.sh">
|
||||
<Filter>Tests\Scripts</Filter>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user