Browse Source

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.
Brad King 7 years ago
parent
commit
d9195ab081
1 changed files with 2 additions and 0 deletions
  1. 2 0
      Tests/RunCMake/RunCTest.cmake

+ 2 - 0
Tests/RunCMake/RunCTest.cmake

@@ -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)