summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/CommandLine/Build-ninja-v-stdout.txt1
-rw-r--r--Tests/RunCMake/CommandLine/Build.cmake5
-rw-r--r--Tests/RunCMake/CommandLine/RunCMakeTest.cmake16
3 files changed, 22 insertions, 0 deletions
diff --git a/Tests/RunCMake/CommandLine/Build-ninja-v-stdout.txt b/Tests/RunCMake/CommandLine/Build-ninja-v-stdout.txt
new file mode 100644
index 0000000..83c62ec
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/Build-ninja-v-stdout.txt
@@ -0,0 +1 @@
+-E echo CustomCommand
diff --git a/Tests/RunCMake/CommandLine/Build.cmake b/Tests/RunCMake/CommandLine/Build.cmake
new file mode 100644
index 0000000..20df108
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/Build.cmake
@@ -0,0 +1,5 @@
+add_custom_command(
+ OUTPUT output.txt
+ COMMAND ${CMAKE_COMMAND} -E echo CustomCommand > output.txt
+ )
+add_custom_target(CustomTarget ALL DEPENDS output.txt)
diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
index 2be6651..a9c49e7 100644
--- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
@@ -18,6 +18,22 @@ run_cmake_command(build-no-generator
run_cmake_command(build-bad-generator
${CMAKE_COMMAND} --build ${RunCMake_SOURCE_DIR}/cache-bad-generator)
+if(RunCMake_GENERATOR STREQUAL "Ninja")
+ # Use a single build tree for a few tests without cleaning.
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/Build-build)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+ file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+
+ set(RunCMake_TEST_OPTIONS -DCMAKE_VERBOSE_MAKEFILE=1)
+ run_cmake(Build)
+ unset(RunCMake_TEST_OPTIONS)
+ run_cmake_command(Build-ninja-v ${CMAKE_COMMAND} --build .)
+
+ unset(RunCMake_TEST_BINARY_DIR)
+ unset(RunCMake_TEST_NO_CLEAN)
+endif()
+
if(UNIX)
run_cmake_command(E_create_symlink-missing-dir
${CMAKE_COMMAND} -E create_symlink T missing-dir/L