]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
cmake: exclude unit tests from the "all" target
authorKefu Chai <kchai@redhat.com>
Thu, 10 Dec 2020 06:54:10 +0000 (14:54 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 10 Dec 2020 10:26:39 +0000 (18:26 +0800)
no need to build unit tests when "make all", unless required explicitly,
like "make tests".

Signed-off-by: Kefu Chai <kchai@redhat.com>
cmake/modules/AddCephTest.cmake

index 9c768987a49ebbcd62f8b52e7dc37f05f6165807..2c8fdb0b93852c24ee725b603a522a5d02693b4d 100644 (file)
@@ -5,9 +5,10 @@ function(add_ceph_test test_name test_path)
   add_test(NAME ${test_name} COMMAND ${test_path} ${ARGN})
   if(TARGET ${test_name})
     add_dependencies(tests ${test_name})
+    set_property(TARGET ${test_name}
+      PROPERTY EXCLUDE_FROM_ALL TRUE)
   endif()
-  set_property(TEST
-    ${test_name}
+  set_property(TEST ${test_name}
     PROPERTY ENVIRONMENT 
     CEPH_ROOT=${CMAKE_SOURCE_DIR}
     CEPH_BIN=${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
@@ -18,8 +19,7 @@ function(add_ceph_test test_name test_path)
     PYTHONPATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cython_modules/lib.3:${CMAKE_SOURCE_DIR}/src/pybind
     CEPH_BUILD_VIRTUALENV=${CEPH_BUILD_VIRTUALENV})
   # none of the tests should take more than 1 hour to complete
-  set_property(TEST
-    ${test_name}
+  set_property(TEST ${test_name}
     PROPERTY TIMEOUT ${CEPH_TEST_TIMEOUT})
 endfunction()