Run all tests with C++11 enabled (#1820)

This commit is contained in:
Benoit Blanchon
2023-02-09 18:57:34 +01:00
parent c2de812cbd
commit 94b2b3f9ce
14 changed files with 8 additions and 48 deletions

View File

@ -2,7 +2,7 @@
# Copyright © 2014-2022, Benoit BLANCHON
# MIT License
set(CMAKE_CXX_STANDARD 98)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
add_subdirectory(catch)
@ -10,7 +10,6 @@ add_subdirectory(catch)
link_libraries(ArduinoJson catch)
include_directories(Helpers)
add_subdirectory(Cpp11)
add_subdirectory(Cpp17)
add_subdirectory(Cpp20)
add_subdirectory(FailingBuilds)

View File

@ -1,36 +0,0 @@
# ArduinoJson - https://arduinojson.org
# Copyright © 2014-2022, Benoit BLANCHON
# MIT License
if("cxx_nullptr" IN_LIST CMAKE_CXX_COMPILE_FEATURES)
list(APPEND SOURCES nullptr.cpp)
add_definitions(-DARDUINOJSON_HAS_NULLPTR=1)
endif()
if("cxx_auto_type" IN_LIST CMAKE_CXX_COMPILE_FEATURES AND "cxx_constexpr" IN_LIST CMAKE_CXX_COMPILE_FEATURES)
list(APPEND SOURCES issue1120.cpp)
endif()
if("cxx_long_long_type" IN_LIST CMAKE_CXX_COMPILE_FEATURES)
list(APPEND SOURCES use_long_long_0.cpp use_long_long_1.cpp)
endif()
if("cxx_range_for" IN_LIST CMAKE_CXX_COMPILE_FEATURES AND "cxx_generalized_initializers" IN_LIST CMAKE_CXX_COMPILE_FEATURES)
list(APPEND SOURCES stl_containers.cpp)
endif()
if(NOT SOURCES)
return()
endif()
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
add_executable(Cpp11Tests ${SOURCES})
add_test(Cpp11 Cpp11Tests)
set_tests_properties(Cpp11
PROPERTIES
LABELS "Catch"
)

View File

@ -31,11 +31,9 @@ add_executable(Issue1189 Issue1189.cpp)
build_should_fail(Issue1189)
add_executable(read_long_long read_long_long.cpp)
set_property(TARGET read_long_long PROPERTY CXX_STANDARD 11)
build_should_fail(read_long_long)
add_executable(write_long_long write_long_long.cpp)
set_property(TARGET write_long_long PROPERTY CXX_STANDARD 11)
build_should_fail(write_long_long)
add_executable(delete_jsondocument delete_jsondocument.cpp)

View File

@ -9,10 +9,6 @@
# error This test requires sizeof(long) < 8
#endif
#if !ARDUINOJSON_HAS_LONG_LONG
# error This test requires C++11
#endif
ARDUINOJSON_ASSERT_INTEGER_TYPE_IS_SUPPORTED(long long)
int main() {
DynamicJsonDocument doc(1024);

View File

@ -12,6 +12,7 @@ add_executable(JsonDocumentTests
DynamicJsonDocument.cpp
ElementProxy.cpp
isNull.cpp
issue1120.cpp
MemberProxy.cpp
nesting.cpp
overflowed.cpp

View File

@ -16,12 +16,14 @@ add_executable(JsonVariantTests
memoryUsage.cpp
misc.cpp
nesting.cpp
nullptr.cpp
or.cpp
overflow.cpp
remove.cpp
set.cpp
shallowCopy.cpp
size.cpp
stl_containers.cpp
subscript.cpp
types.cpp
unbound.cpp

View File

@ -19,6 +19,8 @@ add_executable(MixedConfigurationTests
issue1707.cpp
use_double_0.cpp
use_double_1.cpp
use_long_long_0.cpp
use_long_long_1.cpp
)
set_target_properties(MixedConfigurationTests PROPERTIES UNITY_BUILD OFF)

View File

@ -2,9 +2,6 @@
# Copyright © 2014-2022, Benoit BLANCHON
# MIT License
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED OFF)
add_executable(NumbersTests
convertNumber.cpp
parseFloat.cpp