summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/ctest_build/RunCMakeTest.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-02-04 13:34:09 (GMT)
committerBrad King <brad.king@kitware.com>2022-02-04 13:34:27 (GMT)
commite485dca1e80e2e32848b0770040971fb5b5c103f (patch)
treedd02cbdda0760ececa4855d37bf7ed6816eeef0e /Tests/RunCMake/ctest_build/RunCMakeTest.cmake
parentca4bb89f276e244b5b56d1988cd659d30df1ca5a (diff)
downloadCMake-e485dca1e80e2e32848b0770040971fb5b5c103f.zip
CMake-e485dca1e80e2e32848b0770040971fb5b5c103f.tar.gz
CMake-e485dca1e80e2e32848b0770040971fb5b5c103f.tar.bz2
Tests: Move CTest.BuildCommand.ProjectInSubdir into RunCMake.ctest_build
The former duplicates code that is now part of the infrastructure in the latter. The latter can also explicitly verify the results.
Diffstat (limited to 'Tests/RunCMake/ctest_build/RunCMakeTest.cmake')
-rw-r--r--Tests/RunCMake/ctest_build/RunCMakeTest.cmake12
1 files changed, 12 insertions, 0 deletions
diff --git a/Tests/RunCMake/ctest_build/RunCMakeTest.cmake b/Tests/RunCMake/ctest_build/RunCMakeTest.cmake
index 511cd71..e94a55d 100644
--- a/Tests/RunCMake/ctest_build/RunCMakeTest.cmake
+++ b/Tests/RunCMake/ctest_build/RunCMakeTest.cmake
@@ -49,6 +49,18 @@ function(run_BuildChangeId)
endfunction()
run_BuildChangeId()
+function(run_SubdirTarget)
+ set(CASE_CMAKELISTS_SUFFIX_CODE [=[
+file(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/subdir/CMakeLists.txt [[
+add_custom_target(target_in_subdir COMMAND ${CMAKE_COMMAND} -E touch target_in_subdir.out VERBATIM)
+]])
+add_subdirectory(subdir)
+]=])
+ set(CASE_CTEST_BUILD_ARGS TARGET target_in_subdir)
+ run_ctest(SubdirTarget)
+endfunction()
+run_SubdirTarget()
+
set(RunCMake_USE_CUSTOM_BUILD_COMMAND TRUE)
set(RunCMake_BUILD_COMMAND "${FAKE_BUILD_COMMAND_EXE}")
run_ctest(BuildCommandFailure)