diff --git a/testing/utils/cmake_build_test.cmake b/testing/utils/cmake_build_test.cmake index 7db21900..21ed066d 100644 --- a/testing/utils/cmake_build_test.cmake +++ b/testing/utils/cmake_build_test.cmake @@ -18,5 +18,5 @@ include_guard(GLOBAL) include(utils/cmake_test.cmake) function(add_cmake_build_test source_or_dir) - add_cmake_test(BUILD "${source_or_dir}") + add_cmake_test(BUILD "${source_or_dir}" ${ARGN}) endfunction() diff --git a/testing/utils/cmake_config_test.cmake b/testing/utils/cmake_config_test.cmake index 144a4893..78da2190 100644 --- a/testing/utils/cmake_config_test.cmake +++ b/testing/utils/cmake_config_test.cmake @@ -18,5 +18,5 @@ include_guard(GLOBAL) include(utils/cmake_test.cmake) function(add_cmake_config_test source_or_dir) - add_cmake_test(CONFIG "${source_or_dir}") + add_cmake_test(CONFIG "${source_or_dir}" ${ARGN}) endfunction() diff --git a/testing/utils/cmake_test.cmake b/testing/utils/cmake_test.cmake index 728aa2de..9b3abf41 100644 --- a/testing/utils/cmake_test.cmake +++ b/testing/utils/cmake_test.cmake @@ -33,7 +33,8 @@ adds a test for each generator: .. code-block:: cmake add_cmake_build_test( (config|build|run|install) - + + [SERIAL] ) ``config`` @@ -51,6 +52,10 @@ adds a test for each generator: #]=======================================================================] function(add_cmake_test mode source_or_dir) + set(options SERIAL) + set(one_value) + set(multi_value) + cmake_parse_arguments(RAPIDS_TEST "${options}" "${one_value}" "${multi_value}" ${ARGN}) cmake_detect_generators(supported_generators nice_gen_names) @@ -102,6 +107,10 @@ function(add_cmake_test mode source_or_dir) message(FATAL_ERROR "${mode} mode not one of the valid modes (config|build|install) by add_cmake_build_test") endif() + if(RAPIDS_TEST_SERIAL) + set_tests_properties(${test_name} PROPERTIES RUN_SERIAL ON) + endif() + # Apply a label to the test based on the folder it is in and the generator used get_filename_component(label_name ${CMAKE_CURRENT_LIST_DIR} NAME_WE) string(TOLOWER "${label_name}" lower_case_label ) diff --git a/testing/utils/project_template.cmake.in b/testing/utils/project_template.cmake.in index ad1fc835..81d3e0dd 100644 --- a/testing/utils/project_template.cmake.in +++ b/testing/utils/project_template.cmake.in @@ -15,7 +15,29 @@ #============================================================================= cmake_minimum_required(VERSION 3.20.1) -add_subdirectory("${rapids-cmake-testing-dir}/../" rapids-cmake) +include(FetchContent) + +set(local-rapids-cmake-root "${rapids-cmake-dir}/..") +FetchContent_Declare( + rapids-cmake + GIT_REPOSITORY "${local-rapids-cmake-root}/.git" + GIT_TAG HEAD + ) + +FetchContent_GetProperties(rapids-cmake) +FetchContent_Populate(rapids-cmake) + +# Copy any local uncommited changes over +file(COPY ${local-rapids-cmake-root}/rapids-cmake/ + DESTINATION ${rapids-cmake_SOURCE_DIR}/rapids-cmake/) +file(COPY ${local-rapids-cmake-root}/CMakeLists.txt + DESTINATION ${rapids-cmake_SOURCE_DIR}/) +file(COPY ${local-rapids-cmake-root}/init.cmake + DESTINATION ${rapids-cmake_SOURCE_DIR}/) +file(COPY ${local-rapids-cmake-root}/RAPIDS.cmake + DESTINATION ${rapids-cmake_SOURCE_DIR}/) + +add_subdirectory(${rapids-cmake_SOURCE_DIR} ${rapids-cmake_BINARY_DIR}) # We need to enable at least one language so that we get properly # generated system search paths.