mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-16 14:08:35 +08:00
Tests: Add --build-and-test test case
Checks that giving an invalid build directory to ctest --build-and-test will fail.
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
include(RunCTest)
|
||||
|
||||
run_ctest(dirNotExist)
|
||||
run_ctest(buildAndTestNoBuildDir
|
||||
--build-and-test
|
||||
${RunCMake_BINARY_DIR}/buildAndTestNoBuildDir
|
||||
${RunCMake_BINARY_DIR}/buildAndTestNoBuildDir/CMakeLists.txt # Deliberately a file
|
||||
--build-generator "${RunCMake_GENERATOR}"
|
||||
)
|
||||
|
@@ -0,0 +1,3 @@
|
||||
if(EXISTS ${RunCMake_TEST_BINARY_DIR}/CMakeCache.txt)
|
||||
set(RunCMake_TEST_FAILED "Default build dir ${RunCMake_TEST_BINARY_DIR} was used, should not have been")
|
||||
endif()
|
@@ -0,0 +1 @@
|
||||
^[^0][0-9]*$
|
@@ -0,0 +1,7 @@
|
||||
# We want a single test that always passes. We should never actually get to
|
||||
# configure with this file, so we use a successful configure-build-test
|
||||
# sequence to denote failure of the test case.
|
||||
include(CTest)
|
||||
add_test(NAME willPass
|
||||
COMMAND ${CMAKE_COMMAND} -E touch someFile.txt
|
||||
)
|
Reference in New Issue
Block a user