mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-11 16:50:50 -05:00
Tests/CXXModules: support testing rebuild conditions
This commit is contained in:
@@ -147,6 +147,12 @@ function (run_cxx_module_test directory)
|
|||||||
if (NOT RunCMake_CXXModules_NO_TEST)
|
if (NOT RunCMake_CXXModules_NO_TEST)
|
||||||
run_cmake_command("examples/${test_name}-test" "${CMAKE_CTEST_COMMAND}" -C Debug --output-on-failure)
|
run_cmake_command("examples/${test_name}-test" "${CMAKE_CTEST_COMMAND}" -C Debug --output-on-failure)
|
||||||
endif ()
|
endif ()
|
||||||
|
if (RunCMake_CXXModules_REBUILD)
|
||||||
|
execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 1.125) # handle 1s resolution
|
||||||
|
include("${RunCMake_TEST_SOURCE_DIR}/pre-rebuild.cmake")
|
||||||
|
execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 1.125) # handle 1s resolution
|
||||||
|
run_cmake_command("examples/${test_name}-rebuild" "${CMAKE_COMMAND}" --build . --config Debug)
|
||||||
|
endif ()
|
||||||
endfunction ()
|
endfunction ()
|
||||||
|
|
||||||
function (run_cxx_module_test_target directory target)
|
function (run_cxx_module_test_target directory target)
|
||||||
@@ -155,6 +161,13 @@ function (run_cxx_module_test_target directory target)
|
|||||||
run_cxx_module_test("${directory}" ${ARGN})
|
run_cxx_module_test("${directory}" ${ARGN})
|
||||||
endfunction ()
|
endfunction ()
|
||||||
|
|
||||||
|
function (run_cxx_module_test_rebuild directory)
|
||||||
|
set(RunCMake_CXXModules_INSTALL 0)
|
||||||
|
set(RunCMake_CXXModules_NO_TEST 1)
|
||||||
|
set(RunCMake_CXXModules_REBUILD 1)
|
||||||
|
run_cxx_module_test("${directory}" ${ARGN})
|
||||||
|
endfunction ()
|
||||||
|
|
||||||
string(REPLACE "," ";" CMake_TEST_MODULE_COMPILATION "${CMake_TEST_MODULE_COMPILATION}")
|
string(REPLACE "," ";" CMake_TEST_MODULE_COMPILATION "${CMake_TEST_MODULE_COMPILATION}")
|
||||||
|
|
||||||
if (RunCMake_GENERATOR MATCHES "Ninja")
|
if (RunCMake_GENERATOR MATCHES "Ninja")
|
||||||
|
|||||||
Reference in New Issue
Block a user