Skip to content

Commit

Permalink
cmake: exclude unit tests from the "all" target
Browse files Browse the repository at this point in the history
no need to build unit tests when "make all", unless required explicitly,
like "make tests".

Signed-off-by: Kefu Chai <[email protected]>
  • Loading branch information
tchaikov committed Dec 10, 2020
1 parent 1f5406a commit 461ad21
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cmake/modules/AddCephTest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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()

Expand Down

0 comments on commit 461ad21

Please sign in to comment.