]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake: pass PARALLEL to add_ceph_unittest()
authorKefu Chai <kchai@redhat.com>
Tue, 30 Mar 2021 08:17:14 +0000 (16:17 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 31 Mar 2021 12:03:17 +0000 (20:03 +0800)
and parse it using cmake_parse_arguments(), more flexible this way.

Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit 1a422d447849d9d00f0e1dc5f3f293f871a659a4)

cmake/modules/AddCephTest.cmake
src/test/common/CMakeLists.txt
src/test/crush/CMakeLists.txt
src/test/erasure-code/CMakeLists.txt

index 2c8fdb0b93852c24ee725b603a522a5d02693b4d..8d800444c7438c2fff0f465b4b344f9db64847c5 100644 (file)
@@ -46,8 +46,8 @@ endif()
 #sets uniform compiler flags and link libraries
 function(add_ceph_unittest unittest_name)
   set(UNITTEST "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${unittest_name}")
-  # If the second argument is "parallel", it means we want a parallel run
-  if(WITH_GTEST_PARALLEL AND "${ARGV1}" STREQUAL "parallel")
+  cmake_parse_arguments(UT "PARALLEL" "" "" ${ARGN})
+  if(WITH_GTEST_PARALLEL AND UT_PARALLEL)
     set(UNITTEST ${GTEST_PARALLEL_COMMAND} ${UNITTEST})
   endif()
   add_ceph_test(${unittest_name} "${UNITTEST}")
index a625d8fb43bf6bf821919b78dc5c0fd003211330..a9508f3ceef70cdff3f1bce7212b949a5589fda4 100644 (file)
@@ -152,7 +152,7 @@ add_executable(unittest_throttle
   Throttle.cc
   $<TARGET_OBJECTS:unit-main>
   )
-add_ceph_unittest(unittest_throttle parallel)
+add_ceph_unittest(unittest_throttle PARALLEL)
 target_link_libraries(unittest_throttle global) 
 
 # unittest_lru
index 0c52410f824f073a66c5af44d9a429dc142e61f2..1dae0ca9c59ca55754cfff3c2d777271fe21d641 100644 (file)
@@ -7,7 +7,7 @@ target_link_libraries(unittest_crush_wrapper ceph-common)
 # unittest_crush
 add_executable(unittest_crush
   crush.cc)
-add_ceph_unittest(unittest_crush parallel)
+add_ceph_unittest(unittest_crush PARALLEL)
 target_link_libraries(unittest_crush ceph-common)
 
 add_ceph_test(crush_weights.sh ${CMAKE_CURRENT_SOURCE_DIR}/crush_weights.sh)
index a2950bdc6501585d42698bf22f2040543e6b0195..ff3ba4dc012573fcea4f0f75aea317ec0b33d8a1 100644 (file)
@@ -196,7 +196,7 @@ target_link_libraries(unittest_erasure_code_shec
 add_executable(unittest_erasure_code_shec_all
   TestErasureCodeShec_all.cc
   )
-add_ceph_unittest(unittest_erasure_code_shec_all parallel)
+add_ceph_unittest(unittest_erasure_code_shec_all PARALLEL)
 target_link_libraries(unittest_erasure_code_shec_all
   global
   ${CMAKE_DL_LIBS}