Tests: Add case for 'ctest' run with bad CTestTestfile

This commit is contained in:
Brad King 2015-05-07 10:43:58 -04:00 committed by Stephen Kelly
parent b317b38d33
commit 3837c48334
2 changed files with 17 additions and 0 deletions

View File

@ -0,0 +1,4 @@
^CMake Error at CTestTestfile.cmake:[0-9]+ \(subdirs\):
subdirs called with incorrect number of arguments
+
No tests were found!!!$

View File

@ -26,3 +26,16 @@ function(run_repeat_until_fail_tests)
)
endfunction()
run_repeat_until_fail_tests()
function(run_BadCTestTestfile)
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/BadCTestTestfile)
set(RunCMake_TEST_NO_CLEAN 1)
file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
file(WRITE "${RunCMake_TEST_BINARY_DIR}/CTestTestfile.cmake" "
subdirs()
")
run_cmake_command(BadCTestTestfile ${CMAKE_CTEST_COMMAND})
endfunction()
run_BadCTestTestfile()