From 1c6d7c3be2c289ffcdb4c160d6f192bad5bf783b Mon Sep 17 00:00:00 2001 From: Eugeny Kalishenko Date: Sun, 19 Apr 2015 13:28:12 +0300 Subject: [PATCH] CMake build system introduced (issue #9) --- CMakeLists.txt | 76 +++++- src/CMakeLists.txt | 15 -- tests/CMakeLists.txt | 13 + tests/test-hdr/CMakeLists.txt | 395 +++++++++++++++++++++++++++++++ tests/unit/CMakeLists.txt | 21 ++ tests/unit/map2/CMakeLists.txt | 101 ++++++++ tests/unit/pqueue/CMakeLists.txt | 10 + tests/unit/queue/CMakeLists.txt | 12 + tests/unit/set2/CMakeLists.txt | 39 +++ tests/unit/stack/CMakeLists.txt | 10 + 10 files changed, 667 insertions(+), 25 deletions(-) delete mode 100644 src/CMakeLists.txt create mode 100644 tests/CMakeLists.txt create mode 100644 tests/test-hdr/CMakeLists.txt create mode 100644 tests/unit/CMakeLists.txt create mode 100644 tests/unit/map2/CMakeLists.txt create mode 100644 tests/unit/pqueue/CMakeLists.txt create mode 100644 tests/unit/queue/CMakeLists.txt create mode 100644 tests/unit/set2/CMakeLists.txt create mode 100644 tests/unit/stack/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index aad0857e..68c1e04e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,43 +1,99 @@ -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 2.8.12) cmake_policy(SET CMP0016 NEW) project(cds) set(PROJECT_VERSION 2.1.0) +# Options +option(WITH_TESTS "Build unit tests" OFF) + +find_package(Threads REQUIRED) find_package(Boost COMPONENTS system thread REQUIRED) include_directories(${Boost_INCLUDE_DIRS}) set(CDS_SHARED_LIBRARY ${PROJECT_NAME}) set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin) +set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin) + +if (NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE Debug CACHE STRING "Default build type to Debug" FORCE) +endif() + +message("Build type -- ${CMAKE_BUILD_TYPE}") if(UNIX) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") endif() +set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG") + include_directories(${CMAKE_SOURCE_DIR}) -enable_testing() +# Component names for separate distribution in rpms, debs etc. +set(LIBRARIES_COMPONENT lib) +set(HEADERS_COMPONENT devel) -add_subdirectory(${CMAKE_SOURCE_DIR}/src) +set(SOURCES src/hp_gc.cpp + src/init.cpp + src/dhp_gc.cpp + src/urcu_gp.cpp + src/urcu_sh.cpp + src/michael_heap.cpp + src/topology_hpux.cpp + src/topology_linux.cpp + src/topology_osx.cpp + src/dllmain.cpp) -### FOR PACKAGING ##################################################################################### +add_library(${CDS_SHARED_LIBRARY} SHARED ${SOURCES}) +target_link_libraries(${CDS_SHARED_LIBRARY} PRIVATE ${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}) + +install(TARGETS ${CDS_SHARED_LIBRARY} DESTINATION lib COMPONENT ${LIBRARIES_COMPONENT}) +install(DIRECTORY ${CMAKE_SOURCE_DIR}/cds DESTINATION include COMPONENT ${HEADERS_COMPONENT}) + +if(WITH_TESTS) + enable_testing() + add_subdirectory(${CMAKE_SOURCE_DIR}/tests) +endif(WITH_TESTS) + +### FOR PACKAGING in RPM, TGZ...############################################################################### set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION}) set(CPACK_PACKAGE_NAME ${PROJECT_NAME}) set(CPACK_PACKAGE_RELEASE 1) - -set(CPACK_RPM_PACKAGE_SUMMARY "Library of concurrent data structures") set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/install/description.txt") +set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Library of concurrent data structures") +set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_PACKAGE_RELEASE}") +set(DEPLOY_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}") + +# TGZ specific +set(CPACK_ARCHIVE_COMPONENT_INSTALL ON) + +# RPM specific +set(CPACK_RPM_COMPONENT_INSTALL ON) set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE "${CMAKE_SOURCE_DIR}/install/post_install_script.sh") set(CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE "${CMAKE_SOURCE_DIR}/install/post_uninstall_script.sh") #set(CPACK_RPM_CHANGELOG_FILE ${CHANGELOG_INCLUDE}) set(CPACK_RPM_PACKAGE_LICENSE GPL) set(CPACK_RPM_PACKAGE_GROUP "System Environment/Base") set(CPACK_RPM_PACKAGE_REQUIRES "boost >= 1.50") - set(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION ${CPACK_PACKAGING_INSTALL_PREFIX}) set(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION /usr/local) -set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_PACKAGE_RELEASE}") -set(DEPLOY_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}") -include(CPack) +# DEB specific +set(CPACK_DEBIAN_PACKAGE_DEPENDS "boost (>= 1.50)") + +# Components grouping for Mac OS X and Windows installers +set(CPACK_COMPONENT_${LIBRARIES_COMPONENT}_GROUP "Runtime") +set(CPACK_COMPONENT_${HEADERS_COMPONENT}_GROUP "Development") +set(CPACK_COMPONENT_${LIBRARIES_COMPONENT}_DISPLAY_NAME "Libraries") +set(CPACK_COMPONENT_${HEADERS_COMPONENT}_DISPLAY_NAME "C++ Headers") + +set(CPACK_COMPONENT_${HEADERS_COMPONENT}_DEPENDS ${LIBRARIES_COMPONENT}) + +set(CPACK_COMPONENT_GROUP_DEVELOPMENT_DESCRIPTION "All of the tools you'll ever need to develop lock-free oriented software with libcds") +set(CPACK_COMPONENT_GROUP_RUNTIME_DESCRIPTION "Only libcds library for runtime") + +include(CPack) \ No newline at end of file diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt deleted file mode 100644 index 418b8c89..00000000 --- a/src/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -set(SOURCES hp_gc.cpp - init.cpp - dhp_gc.cpp - urcu_gp.cpp - urcu_sh.cpp - michael_heap.cpp - topology_hpux.cpp - topology_linux.cpp - topology_osx.cpp - dllmain.cpp) - -add_library(${CDS_SHARED_LIBRARY} SHARED ${SOURCES}) -target_link_libraries(${CDS_SHARED_LIBRARY} PRIVATE ${Boost_LIBRARIES}) - -install(TARGETS ${CDS_SHARED_LIBRARY} DESTINATION lib) \ No newline at end of file diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt new file mode 100644 index 00000000..ea088b8d --- /dev/null +++ b/tests/CMakeLists.txt @@ -0,0 +1,13 @@ +set(TEST_COMMON test-common) + +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) + +set(SOURCES cppunit/test_main.cpp + cppunit/thread.cpp + unit/michael_alloc.cpp + unit/ellen_bintree_update_desc_pool.cpp) + +add_library(${TEST_COMMON} OBJECT ${SOURCES}) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/test-hdr) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/unit) \ No newline at end of file diff --git a/tests/test-hdr/CMakeLists.txt b/tests/test-hdr/CMakeLists.txt new file mode 100644 index 00000000..16eb8f92 --- /dev/null +++ b/tests/test-hdr/CMakeLists.txt @@ -0,0 +1,395 @@ +set(PACKAGE_NAME test-hdr) + +set(CDS_TESTHDR_MAP + map/hdr_michael_map_hp.cpp + map/hdr_michael_map_dhp.cpp + map/hdr_michael_map_rcu_gpi.cpp + map/hdr_michael_map_rcu_gpb.cpp + map/hdr_michael_map_rcu_gpt.cpp + map/hdr_michael_map_rcu_shb.cpp + map/hdr_michael_map_rcu_sht.cpp + map/hdr_michael_map_nogc.cpp + map/hdr_michael_map_lazy_hp.cpp + map/hdr_michael_map_lazy_dhp.cpp + map/hdr_michael_map_lazy_rcu_gpi.cpp + map/hdr_michael_map_lazy_rcu_gpb.cpp + map/hdr_michael_map_lazy_rcu_gpt.cpp + map/hdr_michael_map_lazy_rcu_shb.cpp + map/hdr_michael_map_lazy_rcu_sht.cpp + map/hdr_michael_map_lazy_nogc.cpp + map/hdr_refinable_hashmap_hashmap_std.cpp + map/hdr_refinable_hashmap_boost_list.cpp + map/hdr_refinable_hashmap_list.cpp + map/hdr_refinable_hashmap_map.cpp + map/hdr_refinable_hashmap_boost_map.cpp + map/hdr_refinable_hashmap_boost_flat_map.cpp + map/hdr_refinable_hashmap_boost_unordered_map.cpp + map/hdr_refinable_hashmap_slist.cpp + map/hdr_skiplist_map_hp.cpp + map/hdr_skiplist_map_dhp.cpp + map/hdr_skiplist_map_rcu_gpi.cpp + map/hdr_skiplist_map_rcu_gpb.cpp + map/hdr_skiplist_map_rcu_gpt.cpp + map/hdr_skiplist_map_rcu_shb.cpp + map/hdr_skiplist_map_rcu_sht.cpp + map/hdr_skiplist_map_nogc.cpp + map/hdr_splitlist_map_hp.cpp + map/hdr_splitlist_map_dhp.cpp + map/hdr_splitlist_map_nogc.cpp + map/hdr_splitlist_map_rcu_gpi.cpp + map/hdr_splitlist_map_rcu_gpb.cpp + map/hdr_splitlist_map_rcu_gpt.cpp + map/hdr_splitlist_map_rcu_shb.cpp + map/hdr_splitlist_map_rcu_sht.cpp + map/hdr_splitlist_map_lazy_hp.cpp + map/hdr_splitlist_map_lazy_dhp.cpp + map/hdr_splitlist_map_lazy_nogc.cpp + map/hdr_splitlist_map_lazy_rcu_gpi.cpp + map/hdr_splitlist_map_lazy_rcu_gpb.cpp + map/hdr_splitlist_map_lazy_rcu_gpt.cpp + map/hdr_splitlist_map_lazy_rcu_sht.cpp + map/hdr_splitlist_map_lazy_rcu_shb.cpp + map/hdr_striped_hashmap_hashmap_std.cpp + map/hdr_striped_hashmap_boost_list.cpp + map/hdr_striped_hashmap_list.cpp + map/hdr_striped_hashmap_map.cpp + map/hdr_striped_hashmap_boost_map.cpp + map/hdr_striped_hashmap_boost_flat_map.cpp + map/hdr_striped_hashmap_boost_unordered_map.cpp + map/hdr_striped_hashmap_slist.cpp + map/hdr_striped_map_reg.cpp) + +set(CDS_TESTHDR_DEQUE + deque/hdr_fcdeque.cpp) + +set(CDS_TESTHDR_LIST + list/hdr_lazy_dhp.cpp + list/hdr_lazy_hp.cpp + list/hdr_lazy_nogc.cpp + list/hdr_lazy_nogc_unord.cpp + list/hdr_lazy_rcu_gpi.cpp + list/hdr_lazy_rcu_gpb.cpp + list/hdr_lazy_rcu_gpt.cpp + list/hdr_lazy_rcu_shb.cpp + list/hdr_lazy_rcu_sht.cpp + list/hdr_lazy_kv_dhp.cpp + list/hdr_lazy_kv_hp.cpp + list/hdr_lazy_kv_nogc.cpp + list/hdr_lazy_kv_nogc_unord.cpp + list/hdr_lazy_kv_rcu_gpb.cpp + list/hdr_lazy_kv_rcu_gpi.cpp + list/hdr_lazy_kv_rcu_gpt.cpp + list/hdr_lazy_kv_rcu_shb.cpp + list/hdr_lazy_kv_rcu_sht.cpp + list/hdr_michael_dhp.cpp + list/hdr_michael_hp.cpp + list/hdr_michael_nogc.cpp + list/hdr_michael_rcu_gpi.cpp + list/hdr_michael_rcu_gpb.cpp + list/hdr_michael_rcu_gpt.cpp + list/hdr_michael_rcu_shb.cpp + list/hdr_michael_rcu_sht.cpp + list/hdr_michael_kv_dhp.cpp + list/hdr_michael_kv_hp.cpp + list/hdr_michael_kv_nogc.cpp + list/hdr_michael_kv_rcu_gpi.cpp + list/hdr_michael_kv_rcu_gpb.cpp + list/hdr_michael_kv_rcu_gpt.cpp + list/hdr_michael_kv_rcu_shb.cpp + list/hdr_michael_kv_rcu_sht.cpp) + +set(CDS_TESTHDR_PQUEUE + priority_queue/hdr_intrusive_mspqueue_dyn.cpp + priority_queue/hdr_intrusive_mspqueue_static.cpp + priority_queue/hdr_mspqueue_dyn.cpp + priority_queue/hdr_mspqueue_static.cpp + priority_queue/hdr_fcpqueue_boost_stable_vector.cpp + priority_queue/hdr_fcpqueue_deque.cpp + priority_queue/hdr_fcpqueue_vector.cpp + priority_queue/hdr_priority_queue_reg.cpp) + +set(CDS_TESTHDR_QUEUE + queue/hdr_queue_register.cpp + queue/hdr_intrusive_fcqueue.cpp + queue/hdr_intrusive_segmented_queue_hp.cpp + queue/hdr_intrusive_segmented_queue_dhp.cpp + queue/hdr_intrusive_tsigas_cycle_queue.cpp + queue/hdr_intrusive_vyukovmpmc_cycle_queue.cpp + queue/hdr_basketqueue_hp.cpp + queue/hdr_basketqueue_dhp.cpp + queue/hdr_fcqueue.cpp + queue/hdr_moirqueue_hp.cpp + queue/hdr_moirqueue_dhp.cpp + queue/hdr_msqueue_hp.cpp + queue/hdr_msqueue_dhp.cpp + queue/hdr_optimistic_hp.cpp + queue/hdr_optimistic_dhp.cpp + queue/hdr_rwqueue.cpp + queue/hdr_segmented_queue_hp.cpp + queue/hdr_segmented_queue_dhp.cpp + queue/hdr_tsigas_cycle_queue.cpp + queue/hdr_vyukov_mpmc_cyclic.cpp) + +set(CDS_TESTHDR_SET + set/hdr_intrusive_refinable_hashset_avlset.cpp + set/hdr_intrusive_refinable_hashset_list.cpp + set/hdr_intrusive_refinable_hashset_set.cpp + set/hdr_intrusive_refinable_hashset_sgset.cpp + set/hdr_intrusive_refinable_hashset_slist.cpp + set/hdr_intrusive_refinable_hashset_splayset.cpp + set/hdr_intrusive_refinable_hashset_treapset.cpp + set/hdr_intrusive_refinable_hashset_uset.cpp + set/hdr_intrusive_skiplist_hp.cpp + set/hdr_intrusive_skiplist_dhp.cpp + set/hdr_intrusive_skiplist_rcu_gpb.cpp + set/hdr_intrusive_skiplist_rcu_gpi.cpp + set/hdr_intrusive_skiplist_rcu_gpt.cpp + set/hdr_intrusive_skiplist_rcu_shb.cpp + set/hdr_intrusive_skiplist_rcu_sht.cpp + set/hdr_intrusive_skiplist_nogc.cpp + set/hdr_intrusive_striped_hashset_avlset.cpp + set/hdr_intrusive_striped_hashset_list.cpp + set/hdr_intrusive_striped_hashset_set.cpp + set/hdr_intrusive_striped_hashset_sgset.cpp + set/hdr_intrusive_striped_hashset_slist.cpp + set/hdr_intrusive_striped_hashset_splayset.cpp + set/hdr_intrusive_striped_hashset_treapset.cpp + set/hdr_intrusive_striped_hashset_uset.cpp + set/hdr_intrusive_striped_set.cpp + set/hdr_michael_set_hp.cpp + set/hdr_michael_set_dhp.cpp + set/hdr_michael_set_rcu_gpi.cpp + set/hdr_michael_set_rcu_gpb.cpp + set/hdr_michael_set_rcu_gpt.cpp + set/hdr_michael_set_rcu_shb.cpp + set/hdr_michael_set_rcu_sht.cpp + set/hdr_michael_set_nogc.cpp + set/hdr_michael_set_lazy_hp.cpp + set/hdr_michael_set_lazy_dhp.cpp + set/hdr_michael_set_lazy_rcu_gpi.cpp + set/hdr_michael_set_lazy_rcu_gpb.cpp + set/hdr_michael_set_lazy_rcu_gpt.cpp + set/hdr_michael_set_lazy_rcu_shb.cpp + set/hdr_michael_set_lazy_rcu_sht.cpp + set/hdr_michael_set_lazy_nogc.cpp + set/hdr_refinable_hashset_hashset_std.cpp + set/hdr_refinable_hashset_boost_flat_set.cpp + set/hdr_refinable_hashset_boost_list.cpp + set/hdr_refinable_hashset_boost_set.cpp + set/hdr_refinable_hashset_boost_stable_vector.cpp + set/hdr_refinable_hashset_boost_unordered_set.cpp + set/hdr_refinable_hashset_boost_vector.cpp + set/hdr_refinable_hashset_list.cpp + set/hdr_refinable_hashset_set.cpp + set/hdr_refinable_hashset_slist.cpp + set/hdr_refinable_hashset_vector.cpp + set/hdr_skiplist_set_hp.cpp + set/hdr_skiplist_set_dhp.cpp + set/hdr_skiplist_set_rcu_gpi.cpp + set/hdr_skiplist_set_rcu_gpb.cpp + set/hdr_skiplist_set_rcu_gpt.cpp + set/hdr_skiplist_set_rcu_shb.cpp + set/hdr_skiplist_set_rcu_sht.cpp + set/hdr_skiplist_set_nogc.cpp + set/hdr_splitlist_set_hp.cpp + set/hdr_splitlist_set_nogc.cpp + set/hdr_splitlist_set_dhp.cpp + set/hdr_splitlist_set_rcu_gpi.cpp + set/hdr_splitlist_set_rcu_gpb.cpp + set/hdr_splitlist_set_rcu_gpt.cpp + set/hdr_splitlist_set_rcu_shb.cpp + set/hdr_splitlist_set_rcu_sht.cpp + set/hdr_splitlist_set_lazy_hp.cpp + set/hdr_splitlist_set_lazy_nogc.cpp + set/hdr_splitlist_set_lazy_dhp.cpp + set/hdr_splitlist_set_lazy_rcu_gpi.cpp + set/hdr_splitlist_set_lazy_rcu_gpb.cpp + set/hdr_splitlist_set_lazy_rcu_gpt.cpp + set/hdr_splitlist_set_lazy_rcu_shb.cpp + set/hdr_splitlist_set_lazy_rcu_sht.cpp + set/hdr_striped_hashset_hashset_std.cpp + set/hdr_striped_hashset_boost_flat_set.cpp + set/hdr_striped_hashset_boost_list.cpp + set/hdr_striped_hashset_boost_set.cpp + set/hdr_striped_hashset_boost_stable_vector.cpp + set/hdr_striped_hashset_boost_unordered_set.cpp + set/hdr_striped_hashset_boost_vector.cpp + set/hdr_striped_hashset_list.cpp + set/hdr_striped_hashset_set.cpp + set/hdr_striped_hashset_slist.cpp + set/hdr_striped_hashset_vector.cpp) + +set(CDS_TESTHDR_STACK + stack/hdr_intrusive_fcstack.cpp + stack/hdr_treiber_stack_hp.cpp + stack/hdr_treiber_stack_dhp.cpp + stack/hdr_elimination_stack_hp.cpp + stack/hdr_elimination_stack_dhp.cpp + stack/hdr_fcstack.cpp) + +set(CDS_TESTHDR_TREE + tree/hdr_tree_reg.cpp + tree/hdr_intrusive_ellen_bintree_hp.cpp + tree/hdr_intrusive_ellen_bintree_dhp.cpp + tree/hdr_intrusive_ellen_bintree_rcu_gpb.cpp + tree/hdr_intrusive_ellen_bintree_rcu_gpi.cpp + tree/hdr_intrusive_ellen_bintree_rcu_gpt.cpp + tree/hdr_intrusive_ellen_bintree_rcu_shb.cpp + tree/hdr_intrusive_ellen_bintree_rcu_sht.cpp + tree/hdr_ellenbintree_map_hp.cpp + tree/hdr_ellenbintree_map_dhp.cpp + tree/hdr_ellenbintree_map_rcu_gpb.cpp + tree/hdr_ellenbintree_map_rcu_gpi.cpp + tree/hdr_ellenbintree_map_rcu_gpt.cpp + tree/hdr_ellenbintree_map_rcu_shb.cpp + tree/hdr_ellenbintree_map_rcu_sht.cpp + tree/hdr_ellenbintree_set_hp.cpp + tree/hdr_ellenbintree_set_dhp.cpp + tree/hdr_ellenbintree_set_rcu_gpb.cpp + tree/hdr_ellenbintree_set_rcu_gpi.cpp + tree/hdr_ellenbintree_set_rcu_gpt.cpp + tree/hdr_ellenbintree_set_rcu_shb.cpp + tree/hdr_ellenbintree_set_rcu_sht.cpp + tree/hdr_bronson_avltree_map_rcu_gpb.cpp + tree/hdr_bronson_avltree_map_rcu_gpb_pool_monitor.cpp + tree/hdr_bronson_avltree_map_rcu_gpi.cpp + tree/hdr_bronson_avltree_map_rcu_gpi_pool_monitor.cpp + tree/hdr_bronson_avltree_map_rcu_gpt.cpp + tree/hdr_bronson_avltree_map_rcu_gpt_pool_monitor.cpp + tree/hdr_bronson_avltree_map_rcu_shb.cpp + tree/hdr_bronson_avltree_map_rcu_shb_pool_monitor.cpp + tree/hdr_bronson_avltree_map_rcu_sht.cpp + tree/hdr_bronson_avltree_map_rcu_sht_pool_monitor.cpp + ) + +set(CDS_TESTHDR_MISC + misc/cxx11_atomic_class.cpp + misc/cxx11_atomic_func.cpp + misc/find_option.cpp + misc/allocator_test.cpp + misc/michael_allocator.cpp + misc/hash_tuple.cpp + misc/bitop_st.cpp + misc/permutation_generator.cpp + misc/thread_init_fini.cpp) + +set(CDS_TESTHDR_OFFSETOF_MAP + map/hdr_cuckoo_map.cpp) + +set(CDS_TESTHDR_OFFSETOF_SET + set/hdr_cuckoo_set.cpp + set/hdr_intrusive_cuckoo_set.cpp + set/hdr_intrusive_cuckoo_refinable_set.cpp + set/hdr_intrusive_michael_set_hp.cpp + set/hdr_intrusive_michael_set_dhp.cpp + set/hdr_intrusive_michael_set_nogc.cpp + set/hdr_intrusive_michael_set_rcu_gpi.cpp + set/hdr_intrusive_michael_set_rcu_gpb.cpp + set/hdr_intrusive_michael_set_rcu_gpt.cpp + set/hdr_intrusive_michael_set_rcu_shb.cpp + set/hdr_intrusive_michael_set_rcu_sht.cpp + set/hdr_intrusive_michael_set_hp_lazy.cpp + set/hdr_intrusive_michael_set_dhp_lazy.cpp + set/hdr_intrusive_michael_set_nogc_lazy.cpp + set/hdr_intrusive_michael_set_rcu_gpi_lazy.cpp + set/hdr_intrusive_michael_set_rcu_gpb_lazy.cpp + set/hdr_intrusive_michael_set_rcu_gpt_lazy.cpp + set/hdr_intrusive_michael_set_rcu_shb_lazy.cpp + set/hdr_intrusive_michael_set_rcu_sht_lazy.cpp + set/hdr_intrusive_skiplist_hp_member.cpp + set/hdr_intrusive_skiplist_dhp_member.cpp + set/hdr_intrusive_skiplist_rcu_gpi_member.cpp + set/hdr_intrusive_skiplist_rcu_gpb_member.cpp + set/hdr_intrusive_skiplist_rcu_gpt_member.cpp + set/hdr_intrusive_skiplist_rcu_shb_member.cpp + set/hdr_intrusive_skiplist_rcu_sht_member.cpp + set/hdr_intrusive_skiplist_nogc_member.cpp + set/hdr_intrusive_splitlist_set_hp.cpp + set/hdr_intrusive_splitlist_set_nogc.cpp + set/hdr_intrusive_splitlist_set_dhp.cpp + set/hdr_intrusive_splitlist_set_rcu_gpb.cpp + set/hdr_intrusive_splitlist_set_rcu_gpi.cpp + set/hdr_intrusive_splitlist_set_rcu_gpt.cpp + set/hdr_intrusive_splitlist_set_rcu_shb.cpp + set/hdr_intrusive_splitlist_set_rcu_sht.cpp + set/hdr_intrusive_splitlist_set_hp_lazy.cpp + set/hdr_intrusive_splitlist_set_nogc_lazy.cpp + set/hdr_intrusive_splitlist_set_dhp_lazy.cpp + set/hdr_intrusive_splitlist_set_rcu_gpb_lazy.cpp + set/hdr_intrusive_splitlist_set_rcu_gpi_lazy.cpp + set/hdr_intrusive_splitlist_set_rcu_gpt_lazy.cpp + set/hdr_intrusive_splitlist_set_rcu_shb_lazy.cpp + set/hdr_intrusive_splitlist_set_rcu_sht_lazy.cpp) + +set(CDS_TESTHDR_OFFSETOF_LIST + list/hdr_intrusive_lazy_dhp.cpp + list/hdr_intrusive_lazy_hp.cpp + list/hdr_intrusive_lazy_nogc.cpp + list/hdr_intrusive_lazy_nogc_unord.cpp + list/hdr_intrusive_lazy_rcu_gpb.cpp + list/hdr_intrusive_lazy_rcu_gpi.cpp + list/hdr_intrusive_lazy_rcu_gpt.cpp + list/hdr_intrusive_lazy_rcu_shb.cpp + list/hdr_intrusive_lazy_rcu_sht.cpp + list/hdr_intrusive_michael_dhp.cpp + list/hdr_intrusive_michael_hp.cpp + list/hdr_intrusive_michael_nogc.cpp + list/hdr_intrusive_michael_list_rcu_gpb.cpp + list/hdr_intrusive_michael_list_rcu_gpi.cpp + list/hdr_intrusive_michael_list_rcu_gpt.cpp + list/hdr_intrusive_michael_list_rcu_shb.cpp + list/hdr_intrusive_michael_list_rcu_sht.cpp) + +set(CDS_TESTHDR_OFFSETOF_QUEUE + queue/hdr_intrusive_basketqueue_hp.cpp + queue/hdr_intrusive_basketqueue_dhp.cpp + queue/hdr_intrusive_moirqueue_hp.cpp + queue/hdr_intrusive_moirqueue_dhp.cpp + queue/hdr_intrusive_msqueue_hp.cpp + queue/hdr_intrusive_msqueue_dhp.cpp + queue/hdr_intrusive_optimisticqueue_hp.cpp + queue/hdr_intrusive_optimisticqueue_dhp.cpp) + +set(CDS_TESTHDR_OFFSETOF_STACK + stack/hdr_intrusive_treiber_stack_hp.cpp + stack/hdr_intrusive_treiber_stack_dhp.cpp + stack/hdr_intrusive_elimination_stack_hp.cpp + stack/hdr_intrusive_elimination_stack_dhp.cpp) + +set(CDS_TESTHDR_OFFSETOF_TREE + tree/hdr_intrusive_ellen_bintree_hp_member.cpp + tree/hdr_intrusive_ellen_bintree_dhp_member.cpp + tree/hdr_intrusive_ellen_bintree_rcu_gpb_member.cpp + tree/hdr_intrusive_ellen_bintree_rcu_gpi_member.cpp + tree/hdr_intrusive_ellen_bintree_rcu_gpt_member.cpp + tree/hdr_intrusive_ellen_bintree_rcu_shb_member.cpp + tree/hdr_intrusive_ellen_bintree_rcu_sht_member.cpp) + +set(CDS_TESTHDR_OFFSETOF_SOURCES + ${CDS_TESTHDR_OFFSETOF_QUEUE} + ${CDS_TESTHDR_OFFSETOF_STACK} + ${CDS_TESTHDR_OFFSETOF_MAP} + ${CDS_TESTHDR_OFFSETOF_SET} + ${CDS_TESTHDR_OFFSETOF_LIST} + ${CDS_TESTHDR_OFFSETOF_TREE}) + +add_library(test-hdr-offsetof OBJECT ${CDS_TESTHDR_OFFSETOF_SOURCES}) + +if(CMAKE_COMPILER_IS_GNUCC) + set_property(TARGET test-hdr-offsetof APPEND_STRING PROPERTY COMPILE_FLAGS -Wno-invalid-offsetof) +endif(CMAKE_COMPILER_IS_GNUCC) + +set(CDS_TESTHDR_SOURCES + ${CDS_TESTHDR_QUEUE} + ${CDS_TESTHDR_PQUEUE} + ${CDS_TESTHDR_STACK} + ${CDS_TESTHDR_MAP} + ${CDS_TESTHDR_DEQUE} + ${CDS_TESTHDR_LIST} + ${CDS_TESTHDR_SET} + ${CDS_TESTHDR_TREE} + ${CDS_TESTHDR_MISC}) + +add_executable(${PACKAGE_NAME} ${CDS_TESTHDR_SOURCES} $ $) +target_link_libraries(${PACKAGE_NAME} ${CDS_SHARED_LIBRARY} ${Boost_THREAD_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${CMAKE_THREAD_LIBS_INIT}) +add_test(NAME ${PACKAGE_NAME} COMMAND ${PACKAGE_NAME}) \ No newline at end of file diff --git a/tests/unit/CMakeLists.txt b/tests/unit/CMakeLists.txt new file mode 100644 index 00000000..ffd672dd --- /dev/null +++ b/tests/unit/CMakeLists.txt @@ -0,0 +1,21 @@ +set(PACKAGE_NAME cdsu-misc) + +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) + +set(CDSUNIT_MISC_SOURCES + alloc/hoard_threadtest.cpp + alloc/larson.cpp + alloc/linux_scale.cpp + alloc/michael_allocator.cpp + alloc/random.cpp + lock/spinlock.cpp) + +add_executable(${PACKAGE_NAME} ${CDSUNIT_MAP_SOURCES} $) +target_link_libraries(${PACKAGE_NAME} ${CDS_SHARED_LIBRARY} ${Boost_THREAD_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${CMAKE_THREAD_LIBS_INIT}) +add_test(NAME ${PACKAGE_NAME} COMMAND ${PACKAGE_NAME}) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/map2) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/pqueue) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/queue) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/set2) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/stack) \ No newline at end of file diff --git a/tests/unit/map2/CMakeLists.txt b/tests/unit/map2/CMakeLists.txt new file mode 100644 index 00000000..9cd5700c --- /dev/null +++ b/tests/unit/map2/CMakeLists.txt @@ -0,0 +1,101 @@ +set(PACKAGE_NAME cdsu-map) + +set(CDSUNIT_MAP_SOURCES + map_find_int.cpp + map_find_int_bronsonavltree.cpp + map_find_int_cuckoo.cpp + map_find_int_ellentree.cpp + map_find_int_michael.cpp + map_find_int_skip.cpp + map_find_int_split.cpp + map_find_int_striped.cpp + map_find_int_refinable.cpp + map_find_int_std.cpp + map_find_string.cpp + map_find_string_bronsonavltree.cpp + map_find_string_cuckoo.cpp + map_find_string_ellentree.cpp + map_find_string_michael.cpp + map_find_string_skip.cpp + map_find_string_split.cpp + map_find_string_striped.cpp + map_find_string_refinable.cpp + map_find_string_std.cpp + map_insfind_int.cpp + map_insfind_int_bronsonavltree.cpp + map_insfind_int_cuckoo.cpp + map_insfind_int_ellentree.cpp + map_insfind_int_michael.cpp + map_insfind_int_skip.cpp + map_insfind_int_split.cpp + map_insfind_int_striped.cpp + map_insfind_int_refinable.cpp + map_insfind_int_std.cpp + map_insdel_func.cpp + map_insdel_func_michael.cpp + map_insdel_func_split.cpp + map_insdel_func_skip.cpp + map_insdel_func_ellentree.cpp + map_insdel_func_bronsonavltree.cpp + map_insdel_func_striped.cpp + map_insdel_func_refinable.cpp + map_insdel_func_cuckoo.cpp + map_insdel_int.cpp + map_insdel_int_michael.cpp + map_insdel_int_split.cpp + map_insdel_int_skip.cpp + map_insdel_int_ellentree.cpp + map_insdel_int_bronsonavltree.cpp + map_insdel_int_striped.cpp + map_insdel_int_refinable.cpp + map_insdel_int_cuckoo.cpp + map_insdel_item_int.cpp + map_insdel_item_int_michael.cpp + map_insdel_item_int_split.cpp + map_insdel_item_int_skip.cpp + map_insdel_item_int_ellentree.cpp + map_insdel_item_int_bronsonavltree.cpp + map_insdel_item_int_striped.cpp + map_insdel_item_int_refinable.cpp + map_insdel_item_int_cuckoo.cpp + map_insdel_item_string.cpp + map_insdel_item_string_michael.cpp + map_insdel_item_string_split.cpp + map_insdel_item_string_skip.cpp + map_insdel_item_string_ellentree.cpp + map_insdel_item_string_bronsonavltree.cpp + map_insdel_item_string_striped.cpp + map_insdel_item_string_refinable.cpp + map_insdel_item_string_cuckoo.cpp + map_insdel_string.cpp + map_insdel_string_michael.cpp + map_insdel_string_split.cpp + map_insdel_string_skip.cpp + map_insdel_string_ellentree.cpp + map_insdel_string_bronsonavltree.cpp + map_insdel_string_striped.cpp + map_insdel_string_refinable.cpp + map_insdel_string_cuckoo.cpp + map_insdel_string_std.cpp + map_insdelfind.cpp + map_insdelfind_michael.cpp + map_insdelfind_split.cpp + map_insdelfind_skip.cpp + map_insdelfind_ellentree.cpp + map_insdelfind_bronsonavltree.cpp + map_insdelfind_striped.cpp + map_insdelfind_refinable.cpp + map_insdelfind_cuckoo.cpp + map_insdelfind_std.cpp + map_delodd.cpp + map_delodd_michael.cpp + map_delodd_bronsonavltree.cpp + map_delodd_ellentree.cpp + map_delodd_split.cpp + map_delodd_skip.cpp + map_delodd_cuckoo.cpp +) + +add_executable(${PACKAGE_NAME} ${CDSUNIT_MAP_SOURCES} $) +target_link_libraries(${PACKAGE_NAME} ${CDS_SHARED_LIBRARY} ${Boost_THREAD_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${CMAKE_THREAD_LIBS_INIT}) +add_test(NAME ${PACKAGE_NAME} COMMAND ${PACKAGE_NAME}) \ No newline at end of file diff --git a/tests/unit/pqueue/CMakeLists.txt b/tests/unit/pqueue/CMakeLists.txt new file mode 100644 index 00000000..d89a966a --- /dev/null +++ b/tests/unit/pqueue/CMakeLists.txt @@ -0,0 +1,10 @@ +set(PACKAGE_NAME cdsu-pqueue) + +set(CDSUNIT_PQUEUE_SOURCES + pop.cpp + push.cpp + push_pop.cpp) + +add_executable(${PACKAGE_NAME} ${CDSUNIT_PQUEUE_SOURCES} $) +target_link_libraries(${PACKAGE_NAME} ${CDS_SHARED_LIBRARY} ${Boost_THREAD_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${CMAKE_THREAD_LIBS_INIT}) +add_test(NAME ${PACKAGE_NAME} COMMAND ${PACKAGE_NAME}) \ No newline at end of file diff --git a/tests/unit/queue/CMakeLists.txt b/tests/unit/queue/CMakeLists.txt new file mode 100644 index 00000000..82eafd2a --- /dev/null +++ b/tests/unit/queue/CMakeLists.txt @@ -0,0 +1,12 @@ +set(PACKAGE_NAME cdsu-queue) + +set(CDSUNIT_QUEUE_SOURCES + queue_pop.cpp + queue_push.cpp + queue_random.cpp + queue_reader_writer.cpp + intrusive_queue_reader_writer.cpp) + +add_executable(${PACKAGE_NAME} ${CDSUNIT_QUEUE_SOURCES} $) +target_link_libraries(${PACKAGE_NAME} ${CDS_SHARED_LIBRARY} ${Boost_THREAD_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${CMAKE_THREAD_LIBS_INIT}) +add_test(NAME ${PACKAGE_NAME} COMMAND ${PACKAGE_NAME}) \ No newline at end of file diff --git a/tests/unit/set2/CMakeLists.txt b/tests/unit/set2/CMakeLists.txt new file mode 100644 index 00000000..aa26e05e --- /dev/null +++ b/tests/unit/set2/CMakeLists.txt @@ -0,0 +1,39 @@ +set(PACKAGE_NAME cdsu-set) + +set(CDSUNIT_SET_SOURCES + set_insdel_func.cpp + set_insdel_func_cuckoo.cpp + set_insdel_func_ellentree.cpp + set_insdel_func_refinable.cpp + set_insdel_func_skip.cpp + set_insdel_func_split.cpp + set_insdel_func_striped.cpp + set_insdel_string.cpp + set_insdel_string_michael.cpp + set_insdel_string_cuckoo.cpp + set_insdel_string_ellentree.cpp + set_insdel_string_refinable.cpp + set_insdel_string_skip.cpp + set_insdel_string_split.cpp + set_insdel_string_striped.cpp + set_insdel_string_std.cpp + set_insdelfind.cpp + set_insdelfind_michael.cpp + set_insdelfind_cuckoo.cpp + set_insdelfind_ellentree.cpp + set_insdelfind_refinable.cpp + set_insdelfind_skip.cpp + set_insdelfind_split.cpp + set_insdelfind_striped.cpp + set_insdelfind_std.cpp + set_delodd.cpp + set_delodd_cuckoo.cpp + set_delodd_michael.cpp + set_delodd_ellentree.cpp + set_delodd_skip.cpp + set_delodd_split.cpp +) + +add_executable(${PACKAGE_NAME} ${CDSUNIT_SET_SOURCES} $) +target_link_libraries(${PACKAGE_NAME} ${CDS_SHARED_LIBRARY} ${Boost_THREAD_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${CMAKE_THREAD_LIBS_INIT}) +add_test(NAME ${PACKAGE_NAME} COMMAND ${PACKAGE_NAME}) \ No newline at end of file diff --git a/tests/unit/stack/CMakeLists.txt b/tests/unit/stack/CMakeLists.txt new file mode 100644 index 00000000..f521144c --- /dev/null +++ b/tests/unit/stack/CMakeLists.txt @@ -0,0 +1,10 @@ +set(PACKAGE_NAME cdsu-stack) + +set(CDSUNIT_STACK_SOURCES + stack_push.cpp + stack_pushpop.cpp + stack_intrusive_pushpop.cpp) + +add_executable(${PACKAGE_NAME} ${CDSUNIT_STACK_SOURCES} $) +target_link_libraries(${PACKAGE_NAME} ${CDS_SHARED_LIBRARY} ${Boost_THREAD_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${CMAKE_THREAD_LIBS_INIT}) +add_test(NAME ${PACKAGE_NAME} COMMAND ${PACKAGE_NAME}) \ No newline at end of file -- 2.34.1