mirror of
https://github.com/fastfloat/fast_float.git
synced 2025-12-06 16:56:57 +08:00
If we detect that the compiler supports FASTFLOAT_IS_CONSTEXPR, then let us run the tests automatically.
This commit is contained in:
parent
ab6c987ebc
commit
a662df817f
@ -60,7 +60,7 @@ fast_float_add_cpp_test(rcppfastfloat_test)
|
|||||||
fast_float_add_cpp_test(example_test)
|
fast_float_add_cpp_test(example_test)
|
||||||
fast_float_add_cpp_test(example_comma_test)
|
fast_float_add_cpp_test(example_comma_test)
|
||||||
fast_float_add_cpp_test(basictest)
|
fast_float_add_cpp_test(basictest)
|
||||||
option(FASTFLOAT_CONSTEXPR_TESTS "Constexpr tests" OFF)
|
option(FASTFLOAT_CONSTEXPR_TESTS "Require constexpr tests (build will fail if the compiler won't support it)" OFF)
|
||||||
if (FASTFLOAT_CONSTEXPR_TESTS)
|
if (FASTFLOAT_CONSTEXPR_TESTS)
|
||||||
target_compile_features(basictest PRIVATE cxx_std_20)
|
target_compile_features(basictest PRIVATE cxx_std_20)
|
||||||
target_compile_definitions(basictest PRIVATE FASTFLOAT_CONSTEXPR_TESTS)
|
target_compile_definitions(basictest PRIVATE FASTFLOAT_CONSTEXPR_TESTS)
|
||||||
|
|||||||
@ -13,6 +13,12 @@
|
|||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <cfenv>
|
#include <cfenv>
|
||||||
|
|
||||||
|
#if FASTFLOAT_IS_CONSTEXPR
|
||||||
|
#ifndef FASTFLOAT_CONSTEXPR_TESTS
|
||||||
|
#define FASTFLOAT_CONSTEXPR_TESTS 1
|
||||||
|
#endif // #ifndef FASTFLOAT_CONSTEXPR_TESTS
|
||||||
|
#endif // FASTFLOAT_IS_CONSTEXPR
|
||||||
|
|
||||||
#if FASTFLOAT_HAS_BIT_CAST
|
#if FASTFLOAT_HAS_BIT_CAST
|
||||||
#include <bit>
|
#include <bit>
|
||||||
#endif
|
#endif
|
||||||
@ -74,6 +80,10 @@ const char * round_name(int d) {
|
|||||||
|
|
||||||
TEST_CASE("system_info") {
|
TEST_CASE("system_info") {
|
||||||
std::cout << "system info:" << std::endl;
|
std::cout << "system info:" << std::endl;
|
||||||
|
#ifdef FASTFLOAT_CONSTEXPR_TESTS
|
||||||
|
SHOW_DEFINE(FASTFLOAT_CONSTEXPR_TESTS);
|
||||||
|
|
||||||
|
#endif
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
SHOW_DEFINE(_MSC_VER);
|
SHOW_DEFINE(_MSC_VER);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user