diff --git a/CMakeLists.txt b/CMakeLists.txt index 59a7328572c..af4776c3999 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -241,6 +241,11 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") set(OperatingSystem "Mac OS X") endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") +# enables testing and creates Make check command +enable_testing() +set(CMAKE_CTEST_COMMAND ctest -V) +add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND}) + add_subdirectory(src) # man pages must be preprocessed, not supported yet diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5b8298e1308..7ded1c47dc6 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -179,6 +179,8 @@ set(crush_srcs crush/CrushCompiler.cc crush/CrushTester.cc) +add_library(crush STATIC ${crush_srcs}) + add_subdirectory(json_spirit) set(xio_common_srcs) @@ -852,6 +854,27 @@ if(${WITH_RBD}) ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS}) install(TARGETS rbd DESTINATION bin) install(PROGRAMS ${CMAKE_SOURCE_DIR}/src/ceph-rbdnamer DESTINATION bin) + + set(librbd_replay_srcs + rbd_replay/Deser.cc + rbd_replay/ImageNameMap.cc + rbd_replay/PendingIO.cc + rbd_replay/rbd_loc.cc + rbd_replay/Replayer.cc + rbd_replay/Ser.cc) + add_library(librbd_replay STATIC ${librbd_replay_srcs}) + target_link_libraries(librbd_replay PRIVATE librbd librados global udev) + add_executable(rbd_replay + rbd_replay/rbd-replay.cc) + target_link_libraries(rbd_replay librbd librados global librbd_replay) + + set(librbd_replay_ios_srcs + rbd_replay/ios.cc) + add_library(librbd_replay_ios STATIC ${librbd_replay_ios_srcs}) + target_link_libraries(librbd_replay_ios librbd librados global) + + install(TARGETS librbd_replay librbd_replay_ios DESTINATION lib) + endif(${WITH_RBD}) # RadosGW diff --git a/src/erasure-code/CMakeLists.txt b/src/erasure-code/CMakeLists.txt index 484d8958423..8bcba45b276 100644 --- a/src/erasure-code/CMakeLists.txt +++ b/src/erasure-code/CMakeLists.txt @@ -4,6 +4,7 @@ set(erasure_codelibdir ${LIBRARY_OUTPUT_PATH}/erasure-code) add_subdirectory(jerasure) add_subdirectory(lrc) +add_subdirectory(shec) if (HAVE_BETTER_YASM_ELF64) add_subdirectory(isa) diff --git a/src/erasure-code/isa/CMakeLists.txt b/src/erasure-code/isa/CMakeLists.txt index 099cc727322..446e44782fd 100644 --- a/src/erasure-code/isa/CMakeLists.txt +++ b/src/erasure-code/isa/CMakeLists.txt @@ -3,46 +3,46 @@ include_directories(isa-l/include) set(isa_srcs - isa-l/erasure_code/ec_base.c - isa-l/erasure_code/ec_highlevel_func.c - isa-l/erasure_code/ec_multibinary.asm.s - isa-l/erasure_code/gf_2vect_dot_prod_avx2.asm.s - isa-l/erasure_code/gf_2vect_dot_prod_avx.asm.s - isa-l/erasure_code/gf_2vect_dot_prod_sse.asm.s - isa-l/erasure_code/gf_3vect_dot_prod_avx2.asm.s - isa-l/erasure_code/gf_3vect_dot_prod_avx.asm.s - isa-l/erasure_code/gf_3vect_dot_prod_sse.asm.s - isa-l/erasure_code/gf_4vect_dot_prod_avx2.asm.s - isa-l/erasure_code/gf_4vect_dot_prod_avx.asm.s - isa-l/erasure_code/gf_4vect_dot_prod_sse.asm.s - isa-l/erasure_code/gf_5vect_dot_prod_avx2.asm.s - isa-l/erasure_code/gf_5vect_dot_prod_avx.asm.s - isa-l/erasure_code/gf_5vect_dot_prod_sse.asm.s - isa-l/erasure_code/gf_6vect_dot_prod_avx2.asm.s - isa-l/erasure_code/gf_6vect_dot_prod_avx.asm.s - isa-l/erasure_code/gf_6vect_dot_prod_sse.asm.s - isa-l/erasure_code/gf_vect_dot_prod_avx2.asm.s - isa-l/erasure_code/gf_vect_dot_prod_avx.asm.s + isa-l/erasure_code/ec_base.c + isa-l/erasure_code/gf_2vect_dot_prod_sse.asm.s + isa-l/erasure_code/gf_3vect_dot_prod_sse.asm.s + isa-l/erasure_code/gf_4vect_dot_prod_sse.asm.s + isa-l/erasure_code/gf_5vect_dot_prod_sse.asm.s + isa-l/erasure_code/gf_6vect_dot_prod_sse.asm.s isa-l/erasure_code/gf_vect_dot_prod_sse.asm.s - isa-l/erasure_code/gf_2vect_mad_avx2.asm.s - isa-l/erasure_code/gf_2vect_mad_avx.asm.s - isa-l/erasure_code/gf_2vect_mad_sse.asm.s - isa-l/erasure_code/gf_3vect_mad_avx2.asm.s - isa-l/erasure_code/gf_3vect_mad_avx.asm.s - isa-l/erasure_code/gf_3vect_mad_sse.asm.s - isa-l/erasure_code/gf_4vect_mad_avx2.asm.s - isa-l/erasure_code/gf_4vect_mad_avx.asm.s - isa-l/erasure_code/gf_4vect_mad_sse.asm.s - isa-l/erasure_code/gf_5vect_mad_avx2.asm.s - isa-l/erasure_code/gf_5vect_mad_avx.asm.s - isa-l/erasure_code/gf_5vect_mad_sse.asm.s - isa-l/erasure_code/gf_6vect_mad_avx2.asm.s - isa-l/erasure_code/gf_6vect_mad_avx.asm.s - isa-l/erasure_code/gf_6vect_mad_sse.asm.s + isa-l/erasure_code/gf_2vect_mad_avx2.asm.s + isa-l/erasure_code/gf_3vect_mad_avx2.asm.s + isa-l/erasure_code/gf_4vect_mad_avx2.asm.s + isa-l/erasure_code/gf_5vect_mad_avx2.asm.s + isa-l/erasure_code/gf_6vect_mad_avx2.asm.s isa-l/erasure_code/gf_vect_mad_avx2.asm.s + isa-l/erasure_code/ec_highlevel_func.c + isa-l/erasure_code/gf_2vect_mad_avx.asm.s + isa-l/erasure_code/gf_3vect_mad_avx.asm.s + isa-l/erasure_code/gf_4vect_mad_avx.asm.s + isa-l/erasure_code/gf_5vect_mad_avx.asm.s + isa-l/erasure_code/gf_6vect_mad_avx.asm.s isa-l/erasure_code/gf_vect_mad_avx.asm.s + isa-l/erasure_code/ec_multibinary.asm.s + isa-l/erasure_code/gf_2vect_mad_sse.asm.s + isa-l/erasure_code/gf_3vect_mad_sse.asm.s + isa-l/erasure_code/gf_4vect_mad_sse.asm.s + isa-l/erasure_code/gf_5vect_mad_sse.asm.s + isa-l/erasure_code/gf_6vect_mad_sse.asm.s isa-l/erasure_code/gf_vect_mad_sse.asm.s + isa-l/erasure_code/gf_2vect_dot_prod_avx2.asm.s + isa-l/erasure_code/gf_3vect_dot_prod_avx2.asm.s + isa-l/erasure_code/gf_4vect_dot_prod_avx2.asm.s + isa-l/erasure_code/gf_5vect_dot_prod_avx2.asm.s + isa-l/erasure_code/gf_6vect_dot_prod_avx2.asm.s + isa-l/erasure_code/gf_vect_dot_prod_avx2.asm.s isa-l/erasure_code/gf_vect_mul_avx.asm.s + isa-l/erasure_code/gf_2vect_dot_prod_avx.asm.s + isa-l/erasure_code/gf_3vect_dot_prod_avx.asm.s + isa-l/erasure_code/gf_4vect_dot_prod_avx.asm.s + isa-l/erasure_code/gf_5vect_dot_prod_avx.asm.s + isa-l/erasure_code/gf_6vect_dot_prod_avx.asm.s + isa-l/erasure_code/gf_vect_dot_prod_avx.asm.s isa-l/erasure_code/gf_vect_mul_sse.asm.s ErasureCodeIsa.cc ErasureCodeIsaTableCache.cc diff --git a/src/erasure-code/shec/CMakeLists.txt b/src/erasure-code/shec/CMakeLists.txt new file mode 100644 index 00000000000..260f4d21838 --- /dev/null +++ b/src/erasure-code/shec/CMakeLists.txt @@ -0,0 +1,36 @@ +#shec plugin + +set(shec_srcs + ${CMAKE_SOURCE_DIR}/src/erasure-code/ErasureCode.cc + ErasureCodePluginShec.cc + ErasureCodeShec.cc + ErasureCodeShecTableCache.cc + determinant.c + ${CMAKE_SOURCE_DIR}/src/erasure-code/jerasure/jerasure/src/cauchy.c + ${CMAKE_SOURCE_DIR}/src/erasure-code/jerasure/jerasure/src/galois.c + ${CMAKE_SOURCE_DIR}/src/erasure-code/jerasure/jerasure/src/jerasure.c + ${CMAKE_SOURCE_DIR}/src/erasure-code/jerasure/jerasure/src/liberation.c + ${CMAKE_SOURCE_DIR}/src/erasure-code/jerasure/jerasure/src/reed_sol.c + ${CMAKE_SOURCE_DIR}/src/erasure-code/jerasure/gf-complete/src/gf_wgen.c + ${CMAKE_SOURCE_DIR}/src/erasure-code/jerasure/gf-complete/src/gf_method.c + ${CMAKE_SOURCE_DIR}/src/erasure-code/jerasure/gf-complete/src/gf_w16.c + ${CMAKE_SOURCE_DIR}/src/erasure-code/jerasure/gf-complete/src/gf.c + ${CMAKE_SOURCE_DIR}/src/erasure-code/jerasure/gf-complete/src/gf_w32.c + ${CMAKE_SOURCE_DIR}/src/erasure-code/jerasure/gf-complete/src/gf_w64.c + ${CMAKE_SOURCE_DIR}/src/erasure-code/jerasure/gf-complete/src/gf_w128.c + ${CMAKE_SOURCE_DIR}/src/erasure-code/jerasure/gf-complete/src/gf_general.c + ${CMAKE_SOURCE_DIR}/src/erasure-code/jerasure/gf-complete/src/gf_w4.c + ${CMAKE_SOURCE_DIR}/src/erasure-code/jerasure/gf-complete/src/gf_rand.c + ${CMAKE_SOURCE_DIR}/src/erasure-code/jerasure/gf-complete/src/gf_w8.c) + +include_directories(${CMAKE_SOURCE_DIR}/src/erasure-code/jerasure/jerasure/include) +include_directories(${CMAKE_SOURCE_DIR}/src/erasure-code/jerasure/gf-complete/include) +include_directories(${CMAKE_SOURCE_DIR}/src/erasure-code/jerasure) +include_directories(${CMAKE_SOURCE_DIR}/src/erasure-code/shec) +add_library(ec_shec_generic SHARED ${shec_srcs}) +target_link_libraries(ec_shec_generic crush pthread) +add_dependencies(ec_shec_generic ${CMAKE_SOURCE_DIR}/src/ceph_ver.h) +set_target_properties(ec_shec_generic PROPERTIES VERSION 1.0.0 SOVERSION 1) +install(TARGETS ec_shec_generic DESTINATION lib/erasure-code) + +#TODO:build libec_shec_neon, libec_shec+sse3, libec_shec_sse4 libraries diff --git a/src/test/CMakeLists.txt b/src/test/CMakeLists.txt index 6a5f10cc0b8..8baa194d768 100644 --- a/src/test/CMakeLists.txt +++ b/src/test/CMakeLists.txt @@ -300,6 +300,49 @@ add_executable(bench_log target_link_libraries(bench_log global pthread rt ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS}) ## Unit tests +#make check starts here + +add_custom_target(symlinks COMMAND + ln -sf ${CMAKE_SOURCE_DIR}/src/test/ ${CMAKE_BINARY_DIR}/src/test/ && + ln -sf ${CMAKE_BINARY_DIR}/src/ceph-mon ${CMAKE_BINARY_DIR}/src/test/ && + ln -sf ${CMAKE_BINARY_DIR}/ceph ${CMAKE_BINARY_DIR}/src/test/ && + ln -sf ${CMAKE_BINARY_DIR}/src/ceph-authtool ${CMAKE_BINARY_DIR}/src/test/ && + ln -sf ${CMAKE_BINARY_DIR}/src/ceph-conf ${CMAKE_BINARY_DIR}/src/test/ && + ln -sf ${CMAKE_BINARY_DIR}/src/ceph-osd ${CMAKE_BINARY_DIR}/src/test/ && + ln -sf ${CMAKE_SOURCE_DIR}/src/ceph-disk ${CMAKE_BINARY_DIR}/src/test/ && + ln -sf ${CMAKE_SOURCE_DIR}/qa/ ${CMAKE_BINARY_DIR}/src/ + COMMENT "Symlinks for test directory have been created") +add_dependencies(check symlinks) + +add_test(NAME ceph_objectstore_tool COMMAND python ${CMAKE_SOURCE_DIR}/src/test/ceph_objectstore_tool.py) +add_dependencies(check ceph_objectstore_tool) + +add_test(NAME ceph_argparse_py COMMAND python ${CMAKE_SOURCE_DIR}/src/test/pybind/test_ceph_argparse.py) +add_dependencies(check ceph_argparse_py) + +add_test(NAME unittest_bufferlist_shell COMMAND bash ${CMAKE_SOURCE_DIR}/src/unittest_bufferlist.sh) +add_dependencies(check unittest_bufferlist_shell) + +add_test(NAME check_generated COMMAND bash ${CMAKE_SOURCE_DIR}/src/test/encoding/check-generated.sh) +add_dependencies(check check_generated) + +add_test(NAME misc COMMAND bash ${CMAKE_SOURCE_DIR}/src/test/mon/misc.sh) +add_dependencies(check misc) + +add_test(NAME mkfs COMMAND bash ${CMAKE_SOURCE_DIR}/src/test/mon/mkfs.sh) +add_dependencies(check mkfs) + +add_test(NAME ceph_disk COMMAND bash ${CMAKE_SOURCE_DIR}/src/test/ceph-disk.sh) +add_dependencies(check ceph_disk) + +add_test(NAME mon_handle_forward COMMAND bash ${CMAKE_SOURCE_DIR}/src/test/mon/mon-handle-forward.sh) +add_dependencies(check mon_handle_forward) + +add_test(NAME vstart_wrapped_tests COMMAND bash ${CMAKE_SOURCE_DIR}/src/test/vstart_wrapped_tests.sh) +add_dependencies(check mon_handle_forward) + +set(UNITTEST_LIBS gtest_main ${PTHREAD_LIBS}) +set(UNITTEST_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I${CMAKE_SOURCE_DIR}/src/gtest/include -I${CMAKE_BINARY_DIR}/src/gtest/include -fno-strict-aliasing") set(UNITTEST_LIBS gmock_main gmock gtest ${PTHREAD_LIBS}) set(UNITTEST_CXX_FLAGS "-I${CMAKE_SOURCE_DIR}/src/gmock/include -I${CMAKE_BINARY_DIR}/src/gmock/include -I${CMAKE_SOURCE_DIR}/src/gmock/gtest/include -I${CMAKE_BINARY_DIR}/src/gmock/gtest/include -fno-strict-aliasing") @@ -308,12 +351,14 @@ set(UNITTEST_CXX_FLAGS "-I${CMAKE_SOURCE_DIR}/src/gmock/include -I${CMAKE_BINARY set(unittest_encoding_srcs encoding.cc ) -add_executable(unittest_encoding +add_executable(unittest_encoding EXCLUDE_FROM_ALL ${unittest_encoding_srcs} $ ) -target_link_libraries(unittest_encoding cephfs librados pthread rt m - ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS} ${UNITTEST_LIBS}) +add_test(unittest_encoding unittest_encoding) +add_dependencies(check unittest_encoding) +#target_link_libraries(unittest_encoding librados global boost_filesystem +target_link_libraries(unittest_encoding cephfs librados pthread rt m ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS} ${UNITTEST_LIBS}) set_target_properties(unittest_encoding PROPERTIES COMPILE_FLAGS ${UNITTEST_CXX_FLAGS}) @@ -321,46 +366,83 @@ set_target_properties(unittest_encoding set(unittest_addrs_srcs test_addrs.cc ) -add_executable(unittest_addrs +add_executable(unittest_addrs EXCLUDE_FROM_ALL ${unittest_addrs_srcs} $ ) +add_test(unittest_addrs unittest_addrs) +add_dependencies(check unittest_addrs) target_link_libraries(unittest_addrs cephfs librados pthread rt m ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS} ${UNITTEST_LIBS}) set_target_properties(unittest_addrs PROPERTIES COMPILE_FLAGS ${UNITTEST_CXX_FLAGS}) +# unittest_blkdev +set(unittest_blkdev_srcs common/test_blkdev.cc) +add_executable(unittest_blkdev EXCLUDE_FROM_ALL + ${unittest_blkdev_srcs} + $ + ) +add_test(unittest_blkdev unittest_blkdev) +add_dependencies(check unittest_blkdev) +target_link_libraries(unittest_blkdev + global + ${BLKID_LIBRARIES} + ${CMAKE_DL_LIBS} + ${TCMALLOC_LIBS} + ${UNITTEST_LIBS}) +set_target_properties(unittest_blkdev PROPERTIES COMPILE_FLAGS + ${UNITTEST_CXX_FLAGS}) + # unittest_bloom_filter set(unittest_bloom_filter_srcs common/test_bloom_filter.cc ) -add_executable(unittest_bloom_filter +add_executable(unittest_bloom_filter EXCLUDE_FROM_ALL ${unittest_bloom_filter_srcs} $ ) +add_test(unittest_bloom_filter unittest_bloom_filter) +add_dependencies(check unittest_bloom_filter) target_link_libraries(unittest_bloom_filter global ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS} ${UNITTEST_LIBS}) set_target_properties(unittest_bloom_filter PROPERTIES COMPILE_FLAGS ${UNITTEST_CXX_FLAGS}) # unittest_histogram -add_executable(unittest_histogram +add_executable(unittest_histogram EXCLUDE_FROM_ALL common/histogram.cc $ ) +add_test(unittest_histogram unittest_histogram) +add_dependencies(check unittest_histogram) target_link_libraries(unittest_histogram global ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS} ${UNITTEST_LIBS}) set_target_properties(unittest_histogram PROPERTIES COMPILE_FLAGS ${UNITTEST_CXX_FLAGS}) +# unittest_prioritized_queue +add_executable(unittest_prioritized_queue EXCLUDE_FROM_ALL + common/test_prioritized_queue.cc + $ + ) +add_test(unittest_prioritized_queue unittest_prioritized_queue) +add_dependencies(check unittest_prioritized_queue) +target_link_libraries(unittest_prioritized_queue global + ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS} ${UNITTEST_LIBS}) +set_target_properties(unittest_prioritized_queue + PROPERTIES COMPILE_FLAGS ${UNITTEST_CXX_FLAGS}) + # unittest_str_map set(unittest_str_map_srcs common/test_str_map.cc ) -add_executable(unittest_str_map +add_executable(unittest_str_map EXCLUDE_FROM_ALL ${unittest_str_map_srcs} $ ) +add_test(unittest_str_map unittest_str_map) +add_dependencies(check unittest_str_map) target_link_libraries(unittest_str_map common global ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS} ${UNITTEST_LIBS} common) set_target_properties(unittest_str_map @@ -370,23 +452,42 @@ set_target_properties(unittest_str_map set(unittest_sharedptr_registry_srcs common/test_sharedptr_registry.cc ) -add_executable(unittest_sharedptr_registry +add_executable(unittest_sharedptr_registry EXCLUDE_FROM_ALL ${unittest_sharedptr_registry_srcs} $ ) +add_test(unittest_sharedptr_registry unittest_sharedptr_registry) +add_dependencies(check unittest_sharedptr_registry) target_link_libraries(unittest_sharedptr_registry global ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS} ${UNITTEST_LIBS}) set_target_properties(unittest_sharedptr_registry PROPERTIES COMPILE_FLAGS ${UNITTEST_CXX_FLAGS}) +# unittest_shared_cache +set(unittest_shared_cache_srcs + common/test_shared_cache.cc + ) +add_executable(unittest_shared_cache EXCLUDE_FROM_ALL + ${unittest_shared_cache_srscs} + $ + ) +add_test(unittest_shared_cache unittest_shared_cache) +add_dependencies(check unittest_shared_cache) +target_link_libraries(unittest_shared_cache global + ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS} ${UNITTEST_LIBS}) +set_target_properties(unittest_shared_cache + PROPERTIES COMPILE_FLAGS ${UNITTEST_CXX_FLAGS}) + # unittest_sloppy_crc_map set(unittest_sloppy_crc_map_srcs common/test_sloppy_crc_map.cc ) -add_executable(unittest_sloppy_crc_map +add_executable(unittest_sloppy_crc_map EXCLUDE_FROM_ALL ${unittest_sloppy_crc_map_srcs} $ ) +add_test(unittest_sloppy_crc_map unittest_sloppy_crc_map) +add_dependencies(check unittest_sloppy_crc_map) target_link_libraries(unittest_sloppy_crc_map global ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS} ${UNITTEST_LIBS}) set_target_properties(unittest_sloppy_crc_map @@ -397,10 +498,12 @@ set(unittest_util_srcs common/test_util.cc ${CMAKE_SOURCE_DIR}/src/common/util.cc ) -add_executable(unittest_util +add_executable(unittest_util EXCLUDE_FROM_ALL ${unittest_util_srcs} $ ) +add_test(unittest_util unittest_util) +add_dependencies(check unittest_util) target_link_libraries(unittest_util global ${BLKID_LIBRARIES} @@ -411,12 +514,40 @@ target_link_libraries(unittest_util set_target_properties(unittest_util PROPERTIES COMPILE_FLAGS ${UNITTEST_CXX_FLAGS}) +# unittest_crush_wrapper +set(unittest_crush_wrapper_srcs crush/CrushWrapper.cc) +add_executable(unittest_crush_wrapper EXCLUDE_FROM_ALL + ${unittest_crush_wrapper_srcs} + $ + ) +add_test(unittest_crush_wrapper unittest_crush_wrapper) +add_dependencies(check unittest_crush_wrapper) +target_link_libraries(unittest_crush_wrapper global crush ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS} + ${UNITTEST_LIBS}) +set_target_properties(unittest_crush_wrapper PROPERTIES COMPILE_FLAGS + ${UNITTEST_CXX_FLAGS}) + +# unittest_crush +set(unittest_crush_srcs crush/crush.cc) +add_executable(unittest_crush EXCLUDE_FROM_ALL + ${unittest_crush_srcs} + $ + ) +add_test(unittest_crush unittest_crush) +add_dependencies(check unittest_crush) +target_link_libraries(unittest_crush global m ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS} + ${UNITTEST_LIBS} ${EXTRALIBS}) +set_target_properties(unittest_crush PROPERTIES COMPILE_FLAGS + ${UNITTEST_CXX_FLAGS}) + # unittest_osdmap set(unittest_osdmap_srcs osd/TestOSDMap.cc) -add_executable(unittest_osdmap +add_executable(unittest_osdmap EXCLUDE_FROM_ALL ${unittest_osdmap_srcs} $ ) +add_test(unittest_osdmap unittest_osdmap) +add_dependencies(check unittest_osdmap) target_link_libraries(unittest_osdmap global ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS} ${UNITTEST_LIBS}) set_target_properties(unittest_osdmap PROPERTIES COMPILE_FLAGS @@ -424,21 +555,26 @@ set_target_properties(unittest_osdmap PROPERTIES COMPILE_FLAGS # unittest_workqueue set(unittest_workqueue_srcs test_workqueue.cc) -add_executable(unittest_workqueue +add_executable(unittest_workqueue EXCLUDE_FROM_ALL ${unittest_workqueue_srcs} $ ) +add_test(unittest_workqueue unittest_workqueue) +add_dependencies(check unittest_workqueue) target_link_libraries(unittest_workqueue global ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS} ${UNITTEST_LIBS}) set_target_properties(unittest_workqueue PROPERTIES COMPILE_FLAGS ${UNITTEST_CXX_FLAGS}) + # unittest_striper set(unittest_striper_srcs test_striper.cc) -add_executable(unittest_striper +add_executable(unittest_striper EXCLUDE_FROM_ALL ${unittest_striper_srcs} $ ) +add_test(unittest_striper unittest_striper) +add_dependencies(check unittest_striper) target_link_libraries(unittest_striper global ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS} ${UNITTEST_LIBS}) set_target_properties(unittest_striper PROPERTIES COMPILE_FLAGS @@ -446,10 +582,12 @@ set_target_properties(unittest_striper PROPERTIES COMPILE_FLAGS # unittest_prebufferedstreambuf set(unittest_prebufferedstreambuf_srcs test_prebufferedstreambuf.cc) -add_executable(unittest_prebufferedstreambuf +add_executable(unittest_prebufferedstreambuf EXCLUDE_FROM_ALL ${unittest_prebufferedstreambuf_srcs} $ ) +add_test(unittest_prebufferedstreambuf unittest_prebufferedstreambuf) +add_dependencies(check unittest_prebufferedstreambuf) target_link_libraries(unittest_prebufferedstreambuf global ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS} ${UNITTEST_LIBS}) set_target_properties(unittest_prebufferedstreambuf PROPERTIES COMPILE_FLAGS @@ -457,10 +595,12 @@ set_target_properties(unittest_prebufferedstreambuf PROPERTIES COMPILE_FLAGS # unittest_str_list set(unittest_str_list_srcs test_str_list.cc) -add_executable(unittest_str_list +add_executable(unittest_str_list EXCLUDE_FROM_ALL ${unittest_str_list_srcs} $ ) +add_test(unittest_str_list unittest_str_list) +add_dependencies(check unittest_str_list) target_link_libraries(unittest_str_list global ${BLKID_LIBRARIES} ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS} ${UNITTEST_LIBS}) set_target_properties(unittest_str_list PROPERTIES COMPILE_FLAGS @@ -468,10 +608,12 @@ set_target_properties(unittest_str_list PROPERTIES COMPILE_FLAGS # unittest_log set(unittest_log_srcs ${CMAKE_SOURCE_DIR}/src/log/test.cc) -add_executable(unittest_log +add_executable(unittest_log EXCLUDE_FROM_ALL ${unittest_log_srcs} $ ) +add_test(unittest_log unittest_log) +add_dependencies(check unittest_log) target_link_libraries(unittest_log global ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS} ${UNITTEST_LIBS}) set_target_properties(unittest_log PROPERTIES COMPILE_FLAGS @@ -479,10 +621,12 @@ set_target_properties(unittest_log PROPERTIES COMPILE_FLAGS # unittest_throttle set(unittest_throttle_srcs common/Throttle.cc) -add_executable(unittest_throttle +add_executable(unittest_throttle EXCLUDE_FROM_ALL ${unittest_throttle_srcs} $ ) +add_test(unittest_throttle unittest_throttle) +add_dependencies(check unittest_throttle) target_link_libraries(unittest_throttle global ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS} ${UNITTEST_LIBS}) set_target_properties(unittest_throttle PROPERTIES COMPILE_FLAGS @@ -490,19 +634,23 @@ set_target_properties(unittest_throttle PROPERTIES COMPILE_FLAGS # unittest_base64 set(unittest_base64_srcs base64.cc) -add_executable(unittest_base64 +add_executable(unittest_base64 EXCLUDE_FROM_ALL ${unittest_base64_srcs} $ ) +add_test(unittest_base64 unittest_base64) +add_dependencies(check unittest_base64) target_link_libraries(unittest_base64 global ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS} ${UNITTEST_LIBS}) set_target_properties(unittest_base64 PROPERTIES COMPILE_FLAGS ${UNITTEST_CXX_FLAGS}) # unittest_ceph_argparse set(unittest_ceph_argparse_srcs ceph_argparse.cc) -add_executable(unittest_ceph_argparse +add_executable(unittest_ceph_argparse EXCLUDE_FROM_ALL ${unittest_ceph_argparse_srcs} $ ) +add_test(unittest_ceph_argparse unittest_ceph_argparse) +add_dependencies(check unittest_ceph_argparse) target_link_libraries(unittest_ceph_argparse global ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS} ${UNITTEST_LIBS}) set_target_properties(unittest_ceph_argparse PROPERTIES COMPILE_FLAGS @@ -510,32 +658,73 @@ set_target_properties(unittest_ceph_argparse PROPERTIES COMPILE_FLAGS # unittest_ceph_compatset set(unittest_ceph_compatset_srcs ceph_compatset.cc) -add_executable(unittest_ceph_compatset +add_executable(unittest_ceph_compatset EXCLUDE_FROM_ALL ${unittest_ceph_compatset_srcs} $ ) +add_test(unittest_ceph_compatset unittest_ceph_compatset) +add_dependencies(check unittest_ceph_compatset) target_link_libraries(unittest_ceph_compatset global ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS} ${UNITTEST_LIBS}) set_target_properties(unittest_ceph_compatset PROPERTIES COMPILE_FLAGS ${UNITTEST_CXX_FLAGS}) +# unittest_mds_types +add_executable(unittest_mds_types EXCLUDE_FROM_ALL + fs/mds_types.cc + $ + ) +add_test(unittest_mds_types unittest_mds_types) +add_dependencies(check unittest_mds_types) +target_link_libraries(unittest_mds_types global ${CMAKE_DL_LIBS} + ${TCMALLOC_LIBS} ${UNITTEST_LIBS}) +set_target_properties(unittest_mds_types PROPERTIES COMPILE_FLAGS ${UNITTEST_CXX_FLAGS}) + # unittest_osd_types set(unittest_osd_types_srcs osd/types.cc) -add_executable(unittest_osd_types +add_executable(unittest_osd_types EXCLUDE_FROM_ALL ${unittest_osd_types_srcs} $ ) +add_test(unittest_osd_types unittest_osd_types) +add_dependencies(check unittest_osd_types) target_link_libraries(unittest_osd_types global ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS} ${UNITTEST_LIBS}) set_target_properties(unittest_osd_types PROPERTIES COMPILE_FLAGS ${UNITTEST_CXX_FLAGS}) +# unittest_lru +add_executable(unittest_lru EXCLUDE_FROM_ALL + common/test_lru.cc + $ + ) +add_test(unittest_lru unittest_lru) +add_dependencies(check unittest_lru) +target_link_libraries(unittest_lru global ${CMAKE_DL_LIBS} + ${TCMALLOC_LIBS} ${UNITTEST_LIBS}) +set_target_properties(unittest_lru PROPERTIES COMPILE_FLAGS + ${UNITTEST_CXX_FLAGS}) + +# unittest_io_priority +add_executable(unittest_io_priority EXCLUDE_FROM_ALL + common/test_io_priority.cc + $ + ) +add_test(unittest_io_priority unittest_io_priority) +add_dependencies(check unittest_io_priority) +target_link_libraries(unittest_io_priority global ${CMAKE_DL_LIBS} + ${TCMALLOC_LIBS} ${UNITTEST_LIBS}) +set_target_properties(unittest_io_priority PROPERTIES COMPILE_FLAGS + ${UNITTEST_CXX_FLAGS}) + # unittest_gather set(unittest_gather_srcs gather.cc) -add_executable(unittest_gather +add_executable(unittest_gather EXCLUDE_FROM_ALL ${unittest_gather_srcs} $ ) +add_test(unittest_gather unittest_gather) +add_dependencies(check unittest_gather) target_link_libraries(unittest_gather global ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS} ${UNITTEST_LIBS}) set_target_properties(unittest_gather PROPERTIES COMPILE_FLAGS @@ -543,10 +732,12 @@ set_target_properties(unittest_gather PROPERTIES COMPILE_FLAGS # run_cmd set(unittest_run_cmd_srcs run_cmd.cc) -add_executable(unittest_run_cmd +add_executable(unittest_run_cmd EXCLUDE_FROM_ALL ${unittest_run_cmd_srcs} $ ) +add_test(unittest_run_cmd unittest_run_cmd) +add_dependencies(check unittest_run_cmd) target_link_libraries(unittest_run_cmd global ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS} ${UNITTEST_LIBS}) set_target_properties(unittest_run_cmd PROPERTIES COMPILE_FLAGS @@ -554,10 +745,12 @@ set_target_properties(unittest_run_cmd PROPERTIES COMPILE_FLAGS # signals set(unittest_signals_srcs signals.cc) -add_executable(unittest_signals +add_executable(unittest_signals EXCLUDE_FROM_ALL ${unittest_signals_srcs} $ ) +add_test(unittest_signals unittest_signals) +add_dependencies(check unittest_signals) target_link_libraries(unittest_signals global ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS} ${UNITTEST_LIBS}) set_target_properties(unittest_signals PROPERTIES COMPILE_FLAGS @@ -565,21 +758,50 @@ set_target_properties(unittest_signals PROPERTIES COMPILE_FLAGS # unittest_simple_spin set(unittest_simple_spin_srcs simple_spin.cc) -add_executable(unittest_simple_spin +add_executable(unittest_simple_spin EXCLUDE_FROM_ALL ${unittest_simple_spin_srcs} $ ) +add_test(unittest_simple_spin unittest_simple_spin) +add_dependencies(check unittest_simple_spin) target_link_libraries(unittest_simple_spin global ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS} ${UNITTEST_LIBS}) set_target_properties(unittest_simple_spin PROPERTIES COMPILE_FLAGS ${UNITTEST_CXX_FLAGS}) +# unittest_bufferlist +set(unittest_bufferlist_srcs bufferlist.cc) +add_executable(unittest_bufferlist EXCLUDE_FROM_ALL + ${unittest_bufferlist_srcs} + $ + ) +add_test(unittest_bufferlist unittest_bufferlist) +add_dependencies(check unittest_bufferlist) +target_link_libraries(unittest_bufferlist global ${CMAKE_DL_LIBS} + ${TCMALLOC_LIBS} ${UNITTEST_LIBS}) +set_target_properties(unittest_bufferlist PROPERTIES COMPILE_FLAGS + ${UNITTEST_CXX_FLAGS}) + +# unittest_xlist +add_executable(unittest_xlist EXCLUDE_FROM_ALL + test_xlist.cc + $ + ) +add_test(unittest_xlist unittest_xlist) +add_dependencies(check unittest_xlist) +target_link_libraries(unittest_xlist common ${CMAKE_DL_LIBS} + ${TCMALLOC_LIBS} ${UNITTEST_LIBS}) +set_target_properties(unittest_xlist PROPERTIES COMPILE_FLAGS + ${UNITTEST_CXX_FLAGS}) + # unittest_librados set(unittest_librados_srcs librados/librados.cc) -add_executable(unittest_librados +add_executable(unittest_librados EXCLUDE_FROM_ALL ${unittest_librados_srcs} $ ) +add_test(unittest_librados unittest_librados) +add_dependencies(check unittest_librados) target_link_libraries(unittest_librados librados global @@ -591,23 +813,14 @@ target_link_libraries(unittest_librados set_target_properties(unittest_librados PROPERTIES COMPILE_FLAGS ${UNITTEST_CXX_FLAGS}) -# unittest_bufferlist -set(unittest_bufferlist_srcs bufferlist.cc) -add_executable(unittest_bufferlist - ${unittest_bufferlist_srcs} - $ - ) -target_link_libraries(unittest_bufferlist global ${CMAKE_DL_LIBS} - ${TCMALLOC_LIBS} ${UNITTEST_LIBS}) -set_target_properties(unittest_bufferlist PROPERTIES COMPILE_FLAGS - ${UNITTEST_CXX_FLAGS}) - # unittest_crc32 set(unittest_crc32_srcs common/test_crc32c.cc) -add_executable(unittest_crc32 +add_executable(unittest_crc32 EXCLUDE_FROM_ALL ${unittest_crc32_srcs} $ ) +add_test(unittest_crc32 unittest_crc32) +add_dependencies(check unittest_crc32) target_link_libraries(unittest_crc32 global ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS} ${UNITTEST_LIBS}) set_target_properties(unittest_crc32 PROPERTIES COMPILE_FLAGS @@ -615,21 +828,37 @@ set_target_properties(unittest_crc32 PROPERTIES COMPILE_FLAGS # unittest_arch set(unittest_arch_srcs test_arch.cc) -add_executable(unittest_arch +add_executable(unittest_arch EXCLUDE_FROM_ALL ${unittest_arch_srcs} $ ) +add_test(unittest_arch unittest_arch) +add_dependencies(check unittest_arch) target_link_libraries(unittest_arch global ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS} ${UNITTEST_LIBS}) set_target_properties(unittest_arch PROPERTIES COMPILE_FLAGS ${UNITTEST_CXX_FLAGS}) +# unittest_crypto +add_executable(unittest_crypto + crypto.cc + $ + ) +add_test(unittest_crypto unittest_crypto) +add_dependencies(check unittest_crypto) +target_link_libraries(unittest_crypto global ${CMAKE_DL_LIBS} + ${TCMALLOC_LIBS} ${UNITTEST_LIBS}) +set_target_properties(unittest_crypto PROPERTIES COMPILE_FLAGS + ${UNITTEST_CXX_FLAGS}) + # unittest_crypto_init set(unittest_crypto_init_srcs crypto_init.cc) -add_executable(unittest_crypto_init +add_executable(unittest_crypto_init EXCLUDE_FROM_ALL ${unittest_crypto_init_srcs} $ ) +add_test(unittest_crypto_init unittest_crypto_init) +add_dependencies(check unittest_crypto_init) target_link_libraries(unittest_crypto_init global ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS} ${UNITTEST_LIBS}) set_target_properties(unittest_crypto_init PROPERTIES COMPILE_FLAGS @@ -637,10 +866,12 @@ set_target_properties(unittest_crypto_init PROPERTIES COMPILE_FLAGS # unittest_perf_counters set(unittest_perf_counters_srcs perf_counters.cc) -add_executable(unittest_perf_counters +add_executable(unittest_perf_counters EXCLUDE_FROM_ALL ${unittest_perf_counters_srcs} $ ) +add_test(unittest_perf_counters unittest_perf_counters) +add_dependencies(check unittest_perf_counters) target_link_libraries(unittest_perf_counters global ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS} ${UNITTEST_LIBS}) set_target_properties(unittest_perf_counters PROPERTIES COMPILE_FLAGS @@ -648,10 +879,12 @@ set_target_properties(unittest_perf_counters PROPERTIES COMPILE_FLAGS # unittest_admin_socket set(unittest_admin_socket_srcs admin_socket.cc) -add_executable(unittest_admin_socket +add_executable(unittest_admin_socket EXCLUDE_FROM_ALL ${unittest_admin_socket_srcs} $ ) +add_test(unittest_admin_socket unittest_admin_socket) +add_dependencies(check unittest_admin_socket) target_link_libraries(unittest_admin_socket global ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS} ${UNITTEST_LIBS}) set_target_properties(unittest_admin_socket PROPERTIES COMPILE_FLAGS @@ -659,10 +892,12 @@ set_target_properties(unittest_admin_socket PROPERTIES COMPILE_FLAGS # unittest_ceph_crypto set(unittest_ceph_crypto_srcs ceph_crypto.cc) -add_executable(unittest_ceph_crypto +add_executable(unittest_ceph_crypto EXCLUDE_FROM_ALL ${unittest_ceph_crypto_srcs} $ ) +add_test(unittest_ceph_crypto unittest_ceph_crypto) +add_dependencies(check unittest_ceph_crypto) target_link_libraries(unittest_ceph_crypto global ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS} ${UNITTEST_LIBS}) set_target_properties(unittest_ceph_crypto PROPERTIES COMPILE_FLAGS @@ -670,10 +905,12 @@ set_target_properties(unittest_ceph_crypto PROPERTIES COMPILE_FLAGS # unittest_utf8 set(unittest_utf8_srcs utf8.cc) -add_executable(unittest_utf8 +add_executable(unittest_utf8 EXCLUDE_FROM_ALL ${unittest_utf8_srcs} $ ) +add_test(unittest_utf8 unittest_utf8) +add_dependencies(check unittest_utf8) target_link_libraries(unittest_utf8 global ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS} ${UNITTEST_LIBS}) set_target_properties(unittest_utf8 PROPERTIES COMPILE_FLAGS @@ -681,10 +918,12 @@ set_target_properties(unittest_utf8 PROPERTIES COMPILE_FLAGS # unittest_mime set(unittest_mime_srcs mime.cc) -add_executable(unittest_mime +add_executable(unittest_mime EXCLUDE_FROM_ALL ${unittest_mime_srcs} $ ) +add_test(unittest_mime unittest_mime) +add_dependencies(check unittest_mime) target_link_libraries(unittest_mime global ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS} ${UNITTEST_LIBS}) set_target_properties(unittest_mime PROPERTIES COMPILE_FLAGS @@ -692,10 +931,12 @@ set_target_properties(unittest_mime PROPERTIES COMPILE_FLAGS # unittest_escape set(unittest_escape_srcs escape.cc) -add_executable(unittest_escape +add_executable(unittest_escape EXCLUDE_FROM_ALL ${unittest_escape_srcs} $ ) +add_test(unittest_escape unittest_escape) +add_dependencies(check unittest_escape) target_link_libraries(unittest_escape global ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS} ${UNITTEST_LIBS}) set_target_properties(unittest_escape PROPERTIES COMPILE_FLAGS @@ -721,10 +962,12 @@ target_link_libraries(unittest_chain_xattr # unittest_strtol set(unittest_strtol_srcs strtol.cc) -add_executable(unittest_strtol +add_executable(unittest_strtol EXCLUDE_FROM_ALL ${unittest_strtol_srcs} $ ) +add_test(unittest_strtol unittest_strtol) +add_dependencies(check unittest_strtol) target_link_libraries(unittest_strtol global ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS} ${UNITTEST_LIBS}) set_target_properties(unittest_strtol PROPERTIES COMPILE_FLAGS @@ -732,10 +975,12 @@ set_target_properties(unittest_strtol PROPERTIES COMPILE_FLAGS # unittest_confutils set(unittest_confutils_srcs confutils.cc) -add_executable(unittest_confutils +add_executable(unittest_confutils EXCLUDE_FROM_ALL ${unittest_confutils_srcs} $ ) +add_test(unittest_confutils unittest_confutils) +add_dependencies(check unittest_confutils) target_link_libraries(unittest_confutils global ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS} ${UNITTEST_LIBS}) set_target_properties(unittest_confutils PROPERTIES COMPILE_FLAGS @@ -743,10 +988,12 @@ set_target_properties(unittest_confutils PROPERTIES COMPILE_FLAGS # unittest_config set(unittest_config_srcs common/test_config.cc) -add_executable(unittest_config +add_executable(unittest_config EXCLUDE_FROM_ALL ${unittest_config_srcs} $ ) +add_test(unittest_config unittest_config) +add_dependencies(check unittest_config) target_link_libraries(unittest_config global ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS} ${UNITTEST_LIBS}) set_target_properties(unittest_config PROPERTIES COMPILE_FLAGS @@ -754,21 +1001,78 @@ set_target_properties(unittest_config PROPERTIES COMPILE_FLAGS # unittest_context set(unittest_context_srcs common/test_context.cc) -add_executable(unittest_context +add_executable(unittest_context EXCLUDE_FROM_ALL ${unittest_context_srcs} $ ) +add_test(unittest_context unittest_context) +add_dependencies(check unittest_context) target_link_libraries(unittest_context global ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS} ${UNITTEST_LIBS}) set_target_properties(unittest_context PROPERTIES COMPILE_FLAGS ${UNITTEST_CXX_FLAGS}) +# unittest_chain_xattr +set(unittest_chain_xattr_srcs + objectstore/chain_xattr.cc + ) +add_executable(unittest_chain_xattr EXCLUDE_FROM_ALL + ${unittest_chain_xattr_srcs} + $ + ) +set_target_properties(unittest_chain_xattr PROPERTIES COMPILE_FLAGS + ${UNITTEST_CXX_FLAGS}) +add_test(unittest_chain_xattr unittest_chain_xattr) +add_dependencies(check unittest_chain_xattr) +target_link_libraries(unittest_chain_xattr + os + global + ${CMAKE_DL_LIBS} + ${TCMALLOC_LIBS} + ${UNITTEST_LIBS} + ) + +# unittest_flatindex +set(unittest_flatindex_srcs + os/TestFlatIndex.cc + ) +add_executable(unittest_flatindex EXCLUDE_FROM_ALL + ${unittest_flatindex_srcs} + $ + ) +add_test(unittest_flatindex unittest_flatindex) +add_dependencies(check unittest_flatindex) +target_link_libraries(unittest_flatindex + os + global + ${CMAKE_DL_LIBS} + ${TCMALLOC_LIBS} + ${UNITTEST_LIBS} + ) +set_target_properties(unittest_flatindex PROPERTIES COMPILE_FLAGS + ${UNITTEST_CXX_FLAGS}) + +# unittest_safe_io +set(unittest_safe_io_srcs test_safe_io.cc) +add_executable(unittest_safe_io EXCLUDE_FROM_ALL + ${unittest_safe_op_srcs} + $ + ) +add_test(unittest_safe_io unittest_safe_io) +add_dependencies(check unittest_safe_io) +target_link_libraries(unittest_safe_io global ${CMAKE_DL_LIBS} + ${TCMALLOC_LIBS} ${UNITTEST_LIBS}) +set_target_properties(unittest_safe_io PROPERTIES COMPILE_FLAGS + ${UNITTEST_CXX_FLAGS}) + # unittest_heartbeatmap set(unittest_heartbeatmap_srcs heartbeat_map.cc) -add_executable(unittest_heartbeatmap +add_executable(unittest_heartbeatmap EXCLUDE_FROM_ALL ${unittest_heartbeatmap_srcs} $ ) +add_test(unittest_heartbeatmap unittest_heartbeatmap) +add_dependencies(check unittest_heartbeatmap) target_link_libraries(unittest_heartbeatmap global ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS} ${UNITTEST_LIBS}) set_target_properties(unittest_heartbeatmap PROPERTIES COMPILE_FLAGS @@ -776,63 +1080,29 @@ set_target_properties(unittest_heartbeatmap PROPERTIES COMPILE_FLAGS if(${WITH_RADOSGW}) # unittest_formatter + # why does this include rgw/rgw_formats.cc...? set(unittest_formatter_srcs formatter.cc ${CMAKE_SOURCE_DIR}/src/rgw/rgw_formats.cc) - add_executable(unittest_formatter + add_executable(unittest_formatter EXCLUDE_FROM_ALL ${unittest_formatter_srcs} $ ) + add_test(unittest_formatter unittest_formatter) + add_dependencies(check unittest_formatter) target_link_libraries(unittest_formatter global ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS} ${UNITTEST_LIBS}) set_target_properties(unittest_formatter PROPERTIES COMPILE_FLAGS ${UNITTEST_CXX_FLAGS}) endif(${WITH_RADOSGW}) -# unittest_libcephfs_config -set(unittest_libcephfs_config_srcs libcephfs_config.cc) -add_executable(unittest_libcephfs_config - ${unittest_libcephfs_config_srcs} - $ - ) -target_link_libraries(unittest_libcephfs_config cephfs ${CMAKE_DL_LIBS} - ${TCMALLOC_LIBS} ${UNITTEST_LIBS}) -set_target_properties(unittest_libcephfs_config PROPERTIES COMPILE_FLAGS - ${UNITTEST_CXX_FLAGS}) - -# unittest_lfnindex -set(unittest_lfnindex_srcs os/TestLFNIndex.cc) -add_executable(unittest_lfnindex - ${unittest_lfnindex_srcs} - $ - ) -target_link_libraries(unittest_lfnindex os global ${CMAKE_DL_LIBS} - ${TCMALLOC_LIBS} ${UNITTEST_LIBS}) -set_target_properties(unittest_lfnindex PROPERTIES COMPILE_FLAGS - ${UNITTEST_CXX_FLAGS}) - -# unittest_librados_config -set(unittest_librados_config_srcs librados/librados_config.cc) -add_executable(unittest_librados_config - ${unittest_librados_config_srcs} - $ - ) -target_link_libraries(unittest_librados_config - librados - global - ${BLKID_LIBRARIES} - ${CMAKE_DL_LIBS} - ${TCMALLOC_LIBS} - ${UNITTEST_LIBS} - ) -set_target_properties(unittest_librados_config PROPERTIES COMPILE_FLAGS - ${UNITTEST_CXX_FLAGS}) - # unittest_daemon_config set(unittest_daemon_config_srcs daemon_config.cc) -add_executable(unittest_daemon_config +add_executable(unittest_daemon_config EXCLUDE_FROM_ALL ${unittest_daemon_config_srcs} $ ) +add_test(unittest_daemon_config unittest_daemon_config) +add_dependencies(check unittest_daemon_config) target_link_libraries(unittest_daemon_config common global @@ -845,19 +1115,221 @@ target_link_libraries(unittest_daemon_config set_target_properties(unittest_daemon_config PROPERTIES COMPILE_FLAGS ${UNITTEST_CXX_FLAGS}) +# unittest_libcephfs_config +set(unittest_libcephfs_config_srcs libcephfs_config.cc) +add_executable(unittest_libcephfs_config EXCLUDE_FROM_ALL + ${unittest_libcephfs_config_srcs} + $ + ) +add_test(unittest_libcephfs_config unittest_libcephfs_config) +add_dependencies(check unittest_libcephfs_config) +target_link_libraries(unittest_libcephfs_config cephfs ${CMAKE_DL_LIBS} + ${TCMALLOC_LIBS} ${UNITTEST_LIBS}) +set_target_properties(unittest_libcephfs_config PROPERTIES COMPILE_FLAGS + ${UNITTEST_CXX_FLAGS}) + +# unittest_lfnindex +set(unittest_lfnindex_srcs os/TestLFNIndex.cc) +add_executable(unittest_lfnindex EXCLUDE_FROM_ALL + ${unittest_lfnindex_srcs} + $ + ) +add_test(unittest_lfnindex unittest_lfnindex) +add_dependencies(check unittest_lfnindex) +target_link_libraries(unittest_lfnindex os global ${CMAKE_DL_LIBS} + ${TCMALLOC_LIBS} ${UNITTEST_LIBS}) +set_target_properties(unittest_lfnindex PROPERTIES COMPILE_FLAGS + ${UNITTEST_CXX_FLAGS}) + +# unittest_librados_config +set(unittest_librados_config_srcs librados/librados_config.cc) +add_executable(unittest_librados_config EXCLUDE_FROM_ALL + ${unittest_librados_config_srcs} + $ + ) +add_test(unittest_librados_config unittest_librados_config) +add_dependencies(check unittest_librados_config) +target_link_libraries(unittest_librados_config + librados + global + ${BLKID_LIBRARIES} + ${CMAKE_DL_LIBS} + ${TCMALLOC_LIBS} + ${UNITTEST_LIBS} + ) +set_target_properties(unittest_librados_config PROPERTIES COMPILE_FLAGS + ${UNITTEST_CXX_FLAGS}) + +# unittest_rbd_replay +set(unittest_rbd_replay_srcs test_rbd_replay.cc) +add_executable(unittest_rbd_replay EXCLUDE_FROM_ALL + ${unittest_librados_config_srcs} + $ + $ +) +add_test(unittest_rbd_replay unittest_rbd_replay) +add_dependencies(check unittest_rbd_replay) +target_link_libraries(unittest_rbd_replay + librbd + librados + global + librbd_replay + librbd_replay_ios + keyutils + ${BLKID_LIBRARIES} + ${CMAKE_DL_LIBS} + ${TCMALLOC_LIBS} + ${UNITTEST_LIBS} +) +set_target_properties(unittest_rbd_replay PROPERTIES COMPILE_FLAGS +${UNITTEST_CXX_FLAGS}) + # unittest_mon_moncap set(unittest_mon_moncap_srcs mon/moncap.cc) -add_executable(unittest_mon_moncap +add_executable(unittest_mon_moncap EXCLUDE_FROM_ALL ${unittest_mon_moncap_srcs} $ ) +add_test(unittest_mon_moncap unittest_mon_moncap) +add_dependencies(check unittest_mon_moncap) target_link_libraries(unittest_mon_moncap mon global ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS} ${UNITTEST_LIBS}) set_target_properties(unittest_mon_moncap PROPERTIES COMPILE_FLAGS ${UNITTEST_CXX_FLAGS}) +# unittest_mon_pgmap +set(unittest_mon_pgmap_srcs mon/PGMap.cc) +add_executable(unittest_mon_pgmap EXCLUDE_FROM_ALL + ${unittest_mon_moncap_srcs} + $ + ) +add_test(unittest_mon_pgmap unittest_mon_pgmap) +add_dependencies(check unittest_mon_pgmap) +target_link_libraries(unittest_mon_pgmap mon global ${CMAKE_DL_LIBS} + ${TCMALLOC_LIBS} ${UNITTEST_LIBS}) +set_target_properties(unittest_mon_pgmap PROPERTIES COMPILE_FLAGS + ${UNITTEST_CXX_FLAGS}) + +# unittest_ecbackend +set(unittest_ecbackend_srcs osd/TestECBackend.cc) +add_executable(unittest_ecbackend EXCLUDE_FROM_ALL + ${unittest_ecbackend_srcs} + $ + ) +add_test(unittest_ecbackend unittest_ecbackend) +add_dependencies(check unittest_ecbackend) +target_link_libraries(unittest_ecbackend osd global ${CMAKE_DL_LIBS} + ${TCMALLOC_LIBS} ${UNITTEST_LIBS}) +set_target_properties(unittest_ecbackend PROPERTIES COMPILE_FLAGS + ${UNITTEST_CXX_FLAGS}) + +# unittest_osdscrub +add_executable(unittest_osdscrub EXCLUDE_FROM_ALL + osd/TestOSDScrub.cc + $ + ) +add_test(unittest_osdscrub unittest_osdscrub) +add_dependencies(check unittest_osdscrub) +target_link_libraries(unittest_osdscrub osd global dl os mon ${CMAKE_DL_LIBS} + ${BLKID_LIBRARIES} ${TCMALLOC_LIBS} ${UNITTEST_LIBS}) +set_target_properties(unittest_osdscrub PROPERTIES COMPILE_FLAGS + ${UNITTEST_CXX_FLAGS}) + +# unittest_pglog +add_executable(unittest_pglog EXCLUDE_FROM_ALL + osd/TestPGLog.cc + $ + ) +add_test(unittest_pglog unittest_pglog) +add_dependencies(check unittest_pglog) +target_link_libraries(unittest_pglog osd global dl ${CMAKE_DL_LIBS} + ${BLKID_LIBRARIES} ${TCMALLOC_LIBS} ${UNITTEST_LIBS}) +set_target_properties(unittest_pglog PROPERTIES COMPILE_FLAGS + ${UNITTEST_CXX_FLAGS}) + +# unittest_hitset +add_executable(unittest_hitset EXCLUDE_FROM_ALL + osd/hitset.cc + $ + ) +add_test(unittest_hitset unittest_hitset) +add_dependencies(check unittest_hitset) +target_link_libraries(unittest_hitset osd global ${CMAKE_DL_LIBS} + ${BLKID_LIBRARIES} ${TCMALLOC_LIBS} ${UNITTEST_LIBS}) +set_target_properties(unittest_hitset PROPERTIES COMPILE_FLAGS + ${UNITTEST_CXX_FLAGS}) + +# unittest_osd_osdcap +add_executable(unittest_osd_osdcap EXCLUDE_FROM_ALL + osd/osdcap.cc + $ +) +add_test(unittest_osd_osdcap unittest_osd_osdcap) +add_dependencies(check unittest_osd_osdcap) +target_link_libraries(unittest_osd_osdcap osd global ${CMAKE_DL_LIBS} +${BLKID_LIBRARIES} ${TCMALLOC_LIBS} ${UNITTEST_LIBS}) +set_target_properties(unittest_osd_osdcap PROPERTIES COMPILE_FLAGS +${UNITTEST_CXX_FLAGS}) + +# unittest_snap_mapper +add_executable(unittest_snap_mapper EXCLUDE_FROM_ALL + test_snap_mapper.cc + $ + ) +add_test(unittest_snap_mapper unittest_snap_mapper) +add_dependencies(check unittest_snap_mapper) +target_link_libraries(unittest_snap_mapper osd global ${CMAKE_DL_LIBS} + ${BLKID_LIBRARIES} ${TCMALLOC_LIBS} ${UNITTEST_LIBS}) +set_target_properties(unittest_snap_mapper PROPERTIES COMPILE_FLAGS + ${UNITTEST_CXX_FLAGS}) + +if(WITH_SLIBROCKSDB) +# unittest_rocksdb_option_static +add_executable(unittest_rocksdb_option_static EXCLUDE_FROM_ALL + objectstore/TestRocksdbOptionParse.cc + $ + ) +add_test(unittest_rocksdb_option_static unittest_rocksdb_option_static) +add_dependencies(check unittest_rocksdb_option_static) +target_link_libraries(unittest_rocksdb_option_static os librocksdb global ${CMAKE_DL_LIBS} + ${BLKID_LIBRARIES} ${TCMALLOC_LIBS} ${UNITTEST_LIBS}) +set(UNITTEST_ROCKSDB_STATIC_FLAGS "-std=gnu++11 -I rocksdb/include") +set_target_properties(unittest_rocksdb_option_static PROPERTIES COMPILE_FLAGS + ${UNITTEST_CXX_FLAGS} ${LIBROCKSDB_CFLAGS} ${AM_CXXFLAGS} ${UNITTEST_ROCKSDB_STATIC_FLAGS}) +endif(WITH_SLIBROCKSDB) + +if(WITH_DLIBROCKSDB) +# unittest_rocksdb_option +add_executable(unittest_rocksdb_option EXCLUDE_FROM_ALL + objectstore/TestRocksdbOptionParse.cc + $ + ) +add_test(unittest_rocksdb_option_static unittest_rocksdb_option) +add_dependencies(check unittest_rocksdb_option) +target_link_libraries(unittest_rocksdb_option os rocksdb global ${CMAKE_DL_LIBS} + ${BLKID_LIBRARIES} ${TCMALLOC_LIBS} ${UNITTEST_LIBS}) +set(UNITTEST_ROCKSDB_FLAGS "-std=gnu++11") +set_target_properties(unittest_rocksdb_option_static PROPERTIES COMPILE_FLAGS + ${UNITTEST_CXX_FLAGS} ${LIBROCKSDB_CFLAGS} ${AM_CXXFLAGS} ${UNITTEST_ROCKSDB_STATIC_FLAGS}) +endif(WITH_DLIBROCKSDB) + +# unittest_mds_authcap +add_executable(unittest_mds_authcap EXCLUDE_FROM_ALL + mds/TestMDSAuthCaps.cc + $ + ) +add_test(unittest_mds_authcap unittest_mds_authcap) +add_dependencies(check unittest_mds_authcap) +target_link_libraries(unittest_mds_authcap mds global ${CMAKE_DL_LIBS} + ${BLKID_LIBRARIES} ${TCMALLOC_LIBS} ${UNITTEST_LIBS}) +set_target_properties(unittest_mds_authcap PROPERTIES COMPILE_FLAGS + ${UNITTEST_CXX_FLAGS}) + # unittest_ipaddr -add_executable(unittest_ipaddr test_ipaddr.cc) +add_executable(unittest_ipaddr EXCLUDE_FROM_ALL + test_ipaddr.cc) +add_test(unittest_ipaddr unittest_ipaddr) +add_dependencies(check unittest_ipaddr) target_link_libraries(unittest_ipaddr mon global ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS} ${UNITTEST_LIBS}) set_target_properties(unittest_ipaddr PROPERTIES COMPILE_FLAGS @@ -868,10 +1340,12 @@ set(unittest_texttable_srcs test_texttable.cc ${CMAKE_SOURCE_DIR}/src/common/TextTable.cc ) -add_executable(unittest_texttable +add_executable(unittest_texttable EXCLUDE_FROM_ALL ${unittest_texttable_srcs} $ ) +add_test(unittest_texttable unittest_texttable) +add_dependencies(check unittest_texttable) target_link_libraries(unittest_texttable mon global ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS} ${UNITTEST_LIBS}) set_target_properties(unittest_texttable PROPERTIES COMPILE_FLAGS @@ -879,24 +1353,84 @@ set_target_properties(unittest_texttable PROPERTIES COMPILE_FLAGS # unittest_on_exit set(unittest_on_exit_srcs on_exit.cc) -add_executable(unittest_on_exit +add_executable(unittest_on_exit EXCLUDE_FROM_ALL ${unittest_on_exit_srcs} $ ) +add_test(unittest_on_exit unittest_on_exit) +add_dependencies(check unittest_on_exit) target_link_libraries(unittest_on_exit global ${CMAKE_DL_LIBS} ${TCMALLOC_LIBS} ${UNITTEST_LIBS}) +add_test(unittest_on_exit unittest_on_exit) +add_dependencies(check unittest_on_exit) set_target_properties(unittest_on_exit PROPERTIES COMPILE_FLAGS ${UNITTEST_CXX_FLAGS}) +# unittest_readahead +set(unittest_readahead_srcs common/Readahead.cc) +add_executable(unittest_readahead EXCLUDE_FROM_ALL + ${unittest_readahead_srcs} + $ + ) +add_test(unittest_readahead unittest_readahead) +add_dependencies(check unittest_readahead) +target_link_libraries(unittest_readahead + global + ${CMAKE_DL_LIBS} + ${TCMALLOC_LIBS} + ${UNITTEST_LIBS}) +add_test(unittest_readahead unittest_readahead) +add_dependencies(check unittest_readahead) +set_target_properties(unittest_readahead PROPERTIES COMPILE_FLAGS + ${UNITTEST_CXX_FLAGS}) + +# unittest_tableformatter +set(unittest_tableformatter_srcs common/test_tableformatter.cc) +add_executable(unittest_tableformatter EXCLUDE_FROM_ALL + ${unittest_tableformatter_srcs} + $ + ) +add_test(unittest_tableformatter unittest_tableformatter) +add_dependencies(check unittest_tableformatter) +target_link_libraries(unittest_tableformatter + global + ${CMAKE_DL_LIBS} + ${TCMALLOC_LIBS} + ${UNITTEST_LIBS}) +add_test(unittest_tableformatter unittest_tableformatter) +add_dependencies(check unittest_tableformatter) +set_target_properties(unittest_tableformatter PROPERTIES COMPILE_FLAGS + ${UNITTEST_CXX_FLAGS}) + +# unittest_bit_vector +set(unittest_bit_vector_srcs common/test_bit_vector.cc) +add_executable(unittest_bit_vector EXCLUDE_FROM_ALL + ${unittest_bit_vector_srcs} + $ + ) +add_test(unittest_bit_vector unittest_bit_vector) +add_dependencies(check unittest_bit_vector) +target_link_libraries(unittest_bit_vector + global + ${CMAKE_DL_LIBS} + ${TCMALLOC_LIBS} + ${UNITTEST_LIBS}) +add_test(unittest_bit_vector unittest_bit_vector) +add_dependencies(check unittest_bit_vector) +set_target_properties(unittest_bit_vector PROPERTIES COMPILE_FLAGS + ${UNITTEST_CXX_FLAGS}) + # unittest_subprocess set(unittest_subprocess_srcs test_subprocess.cc) -add_executable(unittest_subprocess +add_executable(unittest_subprocess EXCLUDE_FROM_ALL ${unittest_subprocess_srcs} $ ) +add_test(unittest_subprocess unittest_subprocess) +add_dependencies(check unittest_subprocess) target_link_libraries(unittest_subprocess global ${CMAKE_DL_LIBS} @@ -906,11 +1440,31 @@ set_target_properties(unittest_subprocess PROPERTIES COMPILE_FLAGS ${UNITTEST_CXX_FLAGS}) # unittest_pageset -add_executable(unittest_pageset test_pageset.cc) +add_executable(unittest_pageset EXCLUDE_FROM_ALL test_pageset.cc) +add_test(unittest_subprocess unittest_subprocess) +add_dependencies(check unittest_subprocess) target_link_libraries(unittest_pageset ${UNITTEST_LIBS}) set_target_properties(unittest_pageset PROPERTIES COMPILE_FLAGS ${UNITTEST_CXX_FLAGS}) +## unittest_async_compressor +#add_executable(unittest_async_compressor EXCLUDE_FROM_ALL +# common/test_async_compressor.cc +# $ +#) +#add_dependencies(check unittest_async_compressor) +#target_link_libraries(unittest_async_compressor +# global +# compressor +# ${CMAKE_DL_LIBS} +# ${TCMALLOC_LIBS} +# ${UNITTEST_LIBS}) +#set_target_properties(unittest_async_compressor PROPERTIES COMPILE_FLAGS +# ${UNITTEST_CXX_FLAGS}) + +add_subdirectory(erasure-code EXCLUDE_FROM_ALL) +#make check ends here + if(${WITH_RADOSGW}) # test_cors set(test_cors_srcs test_cors.cc) diff --git a/src/test/erasure-code/CMakeLists.txt b/src/test/erasure-code/CMakeLists.txt new file mode 100644 index 00000000000..613e8f009b5 --- /dev/null +++ b/src/test/erasure-code/CMakeLists.txt @@ -0,0 +1,242 @@ +# make check tests for erasure-code directory +# unittest_erasure_code_plugin +add_executable(unittest_erasure_code_plugin EXCLUDE_FROM_ALL + ${CMAKE_SOURCE_DIR}/src/erasure-code/ErasureCode.cc + TestErasureCodePlugin.cc + ) +add_test(unittest_erasure_code_plugin unittest_erasure_code_plugin) +add_dependencies(check unittest_erasure_code_plugin) +target_link_libraries(unittest_erasure_code_plugin + global + osd + common + dl + ${CMAKE_DL_LIBS} + ${TCMALLOC_LIBS} + ${UNITTEST_LIBS}) +set_target_properties(unittest_erasure_code_plugin PROPERTIES COMPILE_FLAGS + ${UNITTEST_CXX_FLAGS}) + +# unittest_erasure_code +add_executable(unittest_erasure_code EXCLUDE_FROM_ALL + ${CMAKE_SOURCE_DIR}/src/erasure-code/ErasureCode.cc + TestErasureCode.cc + ) +add_test(unittest_erasure_code unittest_erasure_code) +add_dependencies(check unittest_erasure_code) +target_link_libraries(unittest_erasure_code + global + osd + common + ${CMAKE_DL_LIBS} + ${TCMALLOC_LIBS} + ${UNITTEST_LIBS}) +set_target_properties(unittest_erasure_code PROPERTIES COMPILE_FLAGS + ${UNITTEST_CXX_FLAGS}) + +# unittest_erasure_code_jerasure +add_executable(unittest_erasure_code_jerasure EXCLUDE_FROM_ALL + TestErasureCodeJerasure.cc +) +add_test(unittest_erasure_code_jerasure unittest_erasure_code_jerasure) +add_dependencies(check unittest_erasure_code_jerasure) +target_link_libraries(unittest_erasure_code_jerasure + global + osd + common + ec_jerasure_generic + ${CMAKE_DL_LIBS} + ${TCMALLOC_LIBS} + ${UNITTEST_LIBS}) +set(UNITTEST_ERASURE_CODE_JERASURE_CXXFLAGS "-Ierasure-code/jerasure/gf-complete/include -Ierasure-code/jerasure/jerasure/include") +set_target_properties(unittest_erasure_code_jerasure PROPERTIES COMPILE_FLAGS + ${UNITTEST_CXX_FLAGS}) + +# unittest_erasure_code_jerasure_plugin +add_executable(unittest_erasure_code_jerasure_plugin EXCLUDE_FROM_ALL + TestErasureCodePluginJerasure.cc + ) +add_test(unittest_erasure_code_jerasure_plugin unittest_erasure_code_jerasure_plugin) +add_dependencies(check unittest_erasure_code_jerasure_plugin) +target_link_libraries(unittest_erasure_code_jerasure_plugin + global + osd + common + ${CMAKE_DL_LIBS} + ${TCMALLOC_LIBS} + ${UNITTEST_LIBS}) +set_target_properties(unittest_erasure_code_jerasure_plugin PROPERTIES COMPILE_FLAGS + ${UNITTEST_CXX_FLAGS}) + +#not sure how to check for YASM_EFL64 right now, setting it true +set(WITH_BETTER_YASM_ELF64 1) +if(WITH_BETTER_YASM_ELF64) + +#unittest_erasure_code_isa +add_executable(unittest_erasure_code_isa EXCLUDE_FROM_ALL + ${CMAKE_SOURCE_DIR}/src/erasure-code/ErasureCode.cc + TestErasureCodeIsa.cc +) +add_test(unittest_erasure_code_isa unittest_erasure_code_isa) +add_dependencies(check unittest_erasure_code_isa) +target_link_libraries(unittest_erasure_code_isa + global + osd + common + ec_isa + erasure_code + dl + ${CMAKE_DL_LIBS} + ${TCMALLOC_LIBS} + ${UNITTEST_LIBS}) +set_target_properties(unittest_erasure_code_isa PROPERTIES COMPILE_FLAGS +${UNITTEST_CXX_FLAGS}) + +#unittest_erasure_code_plugin_isa +add_executable(unittest_erasure_code_plugin_isa EXCLUDE_FROM_ALL + ${CMAKE_SOURCE_DIR}/src/erasure-code/ErasureCode.cc + TestErasureCodePluginIsa.cc +) +add_test(unittest_erasure_code_plugin_isa unittest_erasure_code_plugin_isa) +add_dependencies(check unittest_erasure_code_plugin_isa) +target_link_libraries(unittest_erasure_code_plugin_isa + global + osd + common + ec_isa + crush + dl + erasure_code + ${CMAKE_DL_LIBS} + ${TCMALLOC_LIBS} + ${UNITTEST_LIBS}) +set_target_properties(unittest_erasure_code_plugin_isa PROPERTIES COMPILE_FLAGS +${UNITTEST_CXX_FLAGS}) +endif(WITH_BETTER_YASM_ELF64) + +# unittest_erasure_code_lrc +add_executable(unittest_erasure_code_lrc EXCLUDE_FROM_ALL + TestErasureCodeLrc.cc + ${lrc_srcs} + ) +add_test(unittest_erasure_code_lrc unittest_erasure_code_lrc) +add_dependencies(check unittest_erasure_code_lrc) +target_link_libraries(unittest_erasure_code_lrc + global + osd + dl + ec_lrc + common + ${CMAKE_DL_LIBS} + ${TCMALLOC_LIBS} + ${UNITTEST_LIBS}) +set_target_properties(unittest_erasure_code_lrc PROPERTIES COMPILE_FLAGS + ${UNITTEST_CXX_FLAGS}) + +# unittest_erasure_code_plugin_lrc +add_executable(unittest_erasure_code_plugin_lrc EXCLUDE_FROM_ALL + TestErasureCodePluginLrc.cc + ) +add_test(unittest_erasure_code_plugin_lrc unittest_erasure_code_plugin_lrc) +add_dependencies(check unittest_erasure_code_plugin_lrc) +target_link_libraries(unittest_erasure_code_plugin_lrc + global + osd + dl + common + ${CMAKE_DL_LIBS} + ${TCMALLOC_LIBS} + ${UNITTEST_LIBS}) +set_target_properties(unittest_erasure_code_plugin_lrc PROPERTIES COMPILE_FLAGS + ${UNITTEST_CXX_FLAGS}) + +# unittest_erasure_code_shec +add_executable(unittest_erasure_code_shec EXCLUDE_FROM_ALL + TestErasureCodePluginShec.cc + ) +add_test(unittest_erasure_code_shec unittest_erasure_code_shec) +add_dependencies(check unittest_erasure_code_shec) +target_link_libraries(unittest_erasure_code_shec + global + osd + dl + common + ${CMAKE_DL_LIBS} + ${TCMALLOC_LIBS} + ${UNITTEST_LIBS}) +set_target_properties(unittest_erasure_code_shec PROPERTIES COMPILE_FLAGS + ${UNITTEST_CXX_FLAGS}) + +# unittest_erasure_code_shec_thread +add_executable(unittest_erasure_code_shec_thread EXCLUDE_FROM_ALL + TestErasureCodeShec_thread.cc + ) +add_test(unittest_erasure_code_shec_thread unittest_erasure_code_shec_thread) +add_dependencies(check unittest_erasure_code_shec_thread) +target_link_libraries(unittest_erasure_code_shec_thread + global + osd + dl + common + ec_shec_generic + ${CMAKE_DL_LIBS} + ${TCMALLOC_LIBS} + ${UNITTEST_LIBS}) +set_target_properties(unittest_erasure_code_shec_thread PROPERTIES COMPILE_FLAGS + ${UNITTEST_CXX_FLAGS}) + +# unittest_erasure_code_shec_arguments +add_executable(unittest_erasure_code_shec_arguments EXCLUDE_FROM_ALL + TestErasureCodeShec_arguments.cc + ) +add_test(unittest_erasure_code_shec_arguments unittest_erasure_code_shec_arguments) +add_dependencies(check unittest_erasure_code_shec_arguments) +target_link_libraries(unittest_erasure_code_shec_arguments + global + osd + dl + common + ec_shec_generic + ${CMAKE_DL_LIBS} + ${TCMALLOC_LIBS} + ${UNITTEST_LIBS}) +set_target_properties(unittest_erasure_code_shec_arguments PROPERTIES COMPILE_FLAGS + ${UNITTEST_CXX_FLAGS}) + +# unittest_erasure_code_plugin_shec +add_executable(unittest_erasure_code_plugin_shec EXCLUDE_FROM_ALL + TestErasureCodePluginShec.cc + ) +add_test(unittest_erasure_code_plugin_shec unittest_erasure_code_plugin_shec) +add_dependencies(check unittest_erasure_code_plugin_shec) +target_link_libraries(unittest_erasure_code_plugin_shec + global + osd + dl + common + ec_shec_generic + ${CMAKE_DL_LIBS} + ${TCMALLOC_LIBS} + ${UNITTEST_LIBS}) +set_target_properties(unittest_erasure_code_plugin_shec PROPERTIES COMPILE_FLAGS + ${UNITTEST_CXX_FLAGS}) + +# unittest_erasure_code_example +add_executable(unittest_erasure_code_example EXCLUDE_FROM_ALL +${CMAKE_SOURCE_DIR}/src/erasure-code/ErasureCode.cc + TestErasureCodeExample.cc +) +add_test(unittest_erasure_code_example unittest_erasure_code_example) +add_dependencies(check unittest_erasure_code_example) +target_link_libraries(unittest_erasure_code_example + global + osd + dl + common + erasure_code + ${CMAKE_DL_LIBS} + ${TCMALLOC_LIBS} + ${UNITTEST_LIBS}) +set_target_properties(unittest_erasure_code_example PROPERTIES COMPILE_FLAGS + ${UNITTEST_CXX_FLAGS}) +