summaryrefslogtreecommitdiffstats
path: root/Tests/CMakeLists.txt
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-05-07 14:59:02 (GMT)
committerBrad King <brad.king@kitware.com>2014-05-07 15:02:16 (GMT)
commit54111286453894beb69ad18a9361edc2a50efc84 (patch)
tree2be66f856c661fde65c890374fa7ca3d5d660ed2 /Tests/CMakeLists.txt
parent9cb4677509aa767245cbf4bb9e655d1559bc10bd (diff)
downloadCMake-54111286453894beb69ad18a9361edc2a50efc84.zip
CMake-54111286453894beb69ad18a9361edc2a50efc84.tar.gz
CMake-54111286453894beb69ad18a9361edc2a50efc84.tar.bz2
ctest_build: Do not crash on bad generator name
If creation of the global generator fails, return early with an error message instead of trying to use the generator and crashing. Add a CTestTestBadGenerator test to cover this case. Reported-by: Mathieu Malaterre <malat@debian.org> Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=747306
Diffstat (limited to 'Tests/CMakeLists.txt')
-rw-r--r--Tests/CMakeLists.txt12
1 files changed, 12 insertions, 0 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 8074a01..c903103 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -2245,6 +2245,18 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
PASS_REGULAR_EXPRESSION "${CTestTestBadExe_REGEX}")
configure_file(
+ "${CMake_SOURCE_DIR}/Tests/CTestTestBadGenerator/test.cmake.in"
+ "${CMake_BINARY_DIR}/Tests/CTestTestBadGenerator/test.cmake"
+ @ONLY ESCAPE_QUOTES)
+ add_test(CTestTestBadGenerator ${CMAKE_CTEST_COMMAND}
+ -C "\${CTestTest_CONFIG}"
+ -S "${CMake_BINARY_DIR}/Tests/CTestTestBadGenerator/test.cmake" -V
+ --output-log "${CMake_BINARY_DIR}/Tests/CTestTestBadGenerator/testOutput.log"
+ )
+ set_property(TEST CTestTestBadGenerator PROPERTY
+ PASS_REGULAR_EXPRESSION "could not create generator named \"Bad Generator\"")
+
+ configure_file(
"${CMake_SOURCE_DIR}/Tests/CTestTestParallel/test.cmake.in"
"${CMake_BINARY_DIR}/Tests/CTestTestParallel/test.cmake"
@ONLY ESCAPE_QUOTES)