Tests: Teach run_ctest to handle removal of CTestConfig.cmake

When running tests in a non-fresh build tree there may be files left
from previous test runs.  In the case that a test removes
`CTestConfig.cmake.in`, we must remove any `CTestConfig.cmake` that
may have been left behind.
This commit is contained in:
Brad King 2018-11-26 08:05:13 -05:00
parent 1ca53f5ef1
commit d9195ab081

View File

@ -6,6 +6,8 @@ function(run_ctest CASE_NAME)
if(EXISTS "${RunCMake_SOURCE_DIR}/CTestConfig.cmake.in")
configure_file(${RunCMake_SOURCE_DIR}/CTestConfig.cmake.in
${RunCMake_BINARY_DIR}/${CASE_NAME}/CTestConfig.cmake @ONLY)
else()
file(REMOVE ${RunCMake_BINARY_DIR}/${CASE_NAME}/CTestConfig.cmake)
endif()
configure_file(${RunCMake_SOURCE_DIR}/CMakeLists.txt.in
${RunCMake_BINARY_DIR}/${CASE_NAME}/CMakeLists.txt @ONLY)