From 894762e6865fff1d5fb983a05f4b81b7ec09b542 Mon Sep 17 00:00:00 2001 From: ClausKlein Date: Fri, 22 Dec 2023 13:08:48 +0100 Subject: [PATCH] Add tests for boost serialization --- CMakeLists.txt | 20 ++++--- cmake/{ => Modules}/AddUninstallTarget.cmake | 0 cmake/{ => Modules}/WarningsAsErrors.cmake | 0 libs/chrono.cmake | 2 +- libs/serialization.cmake | 60 ++++++++++++++++++++ 5 files changed, 73 insertions(+), 9 deletions(-) rename cmake/{ => Modules}/AddUninstallTarget.cmake (100%) rename cmake/{ => Modules}/WarningsAsErrors.cmake (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index e93dd844c..54ad2f0d4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,7 @@ if(PROJECT_IS_TOP_LEVEL) else() option(BOOST_DISABLE_TESTS "Do not build test targets, even if building standalone" ON) endif() -option(BOOST_USE_ALL_OPTIONAL_LIBS "Prepare all optional libs" ON) +option(BOOST_USE_ALL_OPTIONAL_LIBS "Prepare all optional libs" OFF) # ---- Add/prepare dependency handling via CPM ---- # see https://github.com/TheLartians/CPM.cmake for more info @@ -102,30 +102,34 @@ endif() set(BOOST_LIBS_REQUIRED header) if(NOT BOOST_USE_ALL_OPTIONAL_LIBS) + # Compiled libs without warnings OSX with clang v17.0.6 list(APPEND BOOST_LIBS_REQUIRED + atomic + chrono + exception + filesystem + math + regex serialization system thread - chrono - atomic - filesystem + timer ) endif() set(BOOST_LIBS_OPTIONAL - # Compiled libs atomic chrono container # warnings context - coroutine + coroutine # depends on test date_time exception fiber # warnings filesystem graph # warnings - iostreams + iostreams # depends on test json # depends on container # FIXME: locale # NOTE: to complex, refactory needed! # TODO(CK) log # errors @@ -246,5 +250,5 @@ packageProject( DEPENDENCIES "Threads" # TODO(CK): variable list needed for: BZIP2; Iconf; ICU; MPI; ZLIB ) -include(cmake/AddUninstallTarget.cmake) +include(AddUninstallTarget) include(CPack) diff --git a/cmake/AddUninstallTarget.cmake b/cmake/Modules/AddUninstallTarget.cmake similarity index 100% rename from cmake/AddUninstallTarget.cmake rename to cmake/Modules/AddUninstallTarget.cmake diff --git a/cmake/WarningsAsErrors.cmake b/cmake/Modules/WarningsAsErrors.cmake similarity index 100% rename from cmake/WarningsAsErrors.cmake rename to cmake/Modules/WarningsAsErrors.cmake diff --git a/libs/chrono.cmake b/libs/chrono.cmake index 4c7acc127..446b7a3df 100644 --- a/libs/chrono.cmake +++ b/libs/chrono.cmake @@ -17,6 +17,6 @@ if(NOT USE_WINDOWS) DOC "rt library" ) if(RT_LIBRARY) - target_link_libraries(chrono PRIVATE ${RT_LIBRARY}) + target_link_libraries(chrono PUBLIC ${RT_LIBRARY}) endif() endif() diff --git a/libs/serialization.cmake b/libs/serialization.cmake index 477ab0d81..b0e6c192f 100644 --- a/libs/serialization.cmake +++ b/libs/serialization.cmake @@ -53,3 +53,63 @@ _add_boost_lib( $<$:/Gy> $<$>:-fvisibility=hidden -fvisibility-inlines-hidden -ftemplate-depth-255> ) + +_add_boost_lib( + NAME serialization_test_A + SOURCES + ${BOOST_SOURCE}/libs/serialization/test/A.cpp +) + +_add_boost_test( + NAME serialization_test + LINK + Boost::serialization_test_A + Boost::serialization + Boost::filesystem + # TODO(CK): DEFINE + # BOOST_HAS_HASH + # BOOST_HAS_SLIST + TESTS + # RUN ${BOOST_SOURCE}/libs/serialization/test/test_map_hashed.cpp + # RUN ${BOOST_SOURCE}/libs/serialization/test/test_set_hashed.cpp + # RUN ${BOOST_SOURCE}/libs/serialization/test/test_slist.cpp + # RUN ${BOOST_SOURCE}/libs/serialization/test/test_slist_ptrs.cpp + RUN ${BOOST_SOURCE}/libs/serialization/test/test_array.cpp + RUN ${BOOST_SOURCE}/libs/serialization/test/test_binary.cpp + RUN ${BOOST_SOURCE}/libs/serialization/test/test_bitset.cpp + RUN ${BOOST_SOURCE}/libs/serialization/test/test_boost_array.cpp + RUN ${BOOST_SOURCE}/libs/serialization/test/test_complex.cpp + RUN ${BOOST_SOURCE}/libs/serialization/test/test_contained_class.cpp + RUN ${BOOST_SOURCE}/libs/serialization/test/test_cyclic_ptrs.cpp + RUN ${BOOST_SOURCE}/libs/serialization/test/test_deque.cpp + RUN ${BOOST_SOURCE}/libs/serialization/test/test_derived_class.cpp + RUN ${BOOST_SOURCE}/libs/serialization/test/test_derived_class_ptr.cpp + RUN ${BOOST_SOURCE}/libs/serialization/test/test_diamond.cpp + RUN ${BOOST_SOURCE}/libs/serialization/test/test_diamond_complex.cpp + RUN ${BOOST_SOURCE}/libs/serialization/test/test_forward_list.cpp + RUN ${BOOST_SOURCE}/libs/serialization/test/test_forward_list_ptrs.cpp + RUN ${BOOST_SOURCE}/libs/serialization/test/test_list.cpp + RUN ${BOOST_SOURCE}/libs/serialization/test/test_list_ptrs.cpp + RUN ${BOOST_SOURCE}/libs/serialization/test/test_map.cpp + RUN ${BOOST_SOURCE}/libs/serialization/test/test_map_boost_unordered.cpp + RUN ${BOOST_SOURCE}/libs/serialization/test/test_map_unordered.cpp + RUN ${BOOST_SOURCE}/libs/serialization/test/test_multiple_ptrs.cpp + RUN ${BOOST_SOURCE}/libs/serialization/test/test_native_array.cpp + RUN ${BOOST_SOURCE}/libs/serialization/test/test_new_operator.cpp + RUN ${BOOST_SOURCE}/libs/serialization/test/test_nvp.cpp + RUN ${BOOST_SOURCE}/libs/serialization/test/test_object.cpp + RUN ${BOOST_SOURCE}/libs/serialization/test/test_optional.cpp + RUN ${BOOST_SOURCE}/libs/serialization/test/test_priority_queue.cpp + RUN ${BOOST_SOURCE}/libs/serialization/test/test_queue.cpp + RUN ${BOOST_SOURCE}/libs/serialization/test/test_recursion.cpp + RUN ${BOOST_SOURCE}/libs/serialization/test/test_set.cpp + RUN ${BOOST_SOURCE}/libs/serialization/test/test_set_boost_unordered.cpp + RUN ${BOOST_SOURCE}/libs/serialization/test/test_set_unordered.cpp + RUN ${BOOST_SOURCE}/libs/serialization/test/test_shared_ptr.cpp + RUN ${BOOST_SOURCE}/libs/serialization/test/test_simple_class.cpp + RUN ${BOOST_SOURCE}/libs/serialization/test/test_simple_class_ptr.cpp + RUN ${BOOST_SOURCE}/libs/serialization/test/test_stack.cpp + RUN ${BOOST_SOURCE}/libs/serialization/test/test_unique_ptr.cpp + RUN ${BOOST_SOURCE}/libs/serialization/test/test_variant.cpp + RUN ${BOOST_SOURCE}/libs/serialization/test/test_vector.cpp +)