summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/Ninja/RunCMakeTest.cmake
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2017-04-18 19:05:35 (GMT)
committerBen Boeckel <ben.boeckel@kitware.com>2017-04-21 12:57:40 (GMT)
commit664591ce59792f6508d6376aca916ab0f02d213f (patch)
tree5dfdf6ff0ecad92304bd8e152ec0c9bfb0d50646 /Tests/RunCMake/Ninja/RunCMakeTest.cmake
parentadf60b28384025d5b83c2df5a66f2190753e2695 (diff)
downloadCMake-664591ce59792f6508d6376aca916ab0f02d213f.zip
CMake-664591ce59792f6508d6376aca916ab0f02d213f.tar.gz
CMake-664591ce59792f6508d6376aca916ab0f02d213f.tar.bz2
RunCMake.Ninja: add a test for assumed sources
This is a dark corner of the Ninja generator. It should be fixed in the future, but add a test which shows its behaviors.
Diffstat (limited to 'Tests/RunCMake/Ninja/RunCMakeTest.cmake')
-rw-r--r--Tests/RunCMake/Ninja/RunCMakeTest.cmake16
1 files changed, 16 insertions, 0 deletions
diff --git a/Tests/RunCMake/Ninja/RunCMakeTest.cmake b/Tests/RunCMake/Ninja/RunCMakeTest.cmake
index fb7798d..8c3bc20 100644
--- a/Tests/RunCMake/Ninja/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Ninja/RunCMakeTest.cmake
@@ -112,6 +112,22 @@ function (run_LooseObjectDepends)
endfunction ()
run_LooseObjectDepends()
+function (run_AssumedSources)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/AssumedSources-build)
+ run_cmake(AssumedSources)
+ run_ninja("${RunCMake_TEST_BINARY_DIR}" "target.c")
+ if (NOT EXISTS "${RunCMake_TEST_BINARY_DIR}/target.c")
+ message(FATAL_ERROR
+ "Dependencies for an assumed source did not hook up properly for 'target.c'.")
+ endif ()
+ run_ninja("${RunCMake_TEST_BINARY_DIR}" "target-no-depends.c")
+ if (EXISTS "${RunCMake_TEST_BINARY_DIR}/target-no-depends.c")
+ message(FATAL_ERROR
+ "Dependencies for an assumed source were magically hooked up for 'target-no-depends.c'.")
+ endif ()
+endfunction ()
+run_AssumedSources()
+
function(sleep delay)
execute_process(
COMMAND ${CMAKE_COMMAND} -E sleep ${delay}