summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/Ninja
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-03-23 13:48:07 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2015-03-23 13:48:07 (GMT)
commit64e97edad7c8d4b8a2585067db206ad9a57d68f6 (patch)
tree2482c4e20a610739aa3621461e806970f398f2d9 /Tests/RunCMake/Ninja
parent7ef5f240c80bae10701eda5a1592d0516668a85e (diff)
parentbd9c7f9b2c788f9bf69c2ce4eb93d27212a6dfaa (diff)
downloadCMake-64e97edad7c8d4b8a2585067db206ad9a57d68f6.zip
CMake-64e97edad7c8d4b8a2585067db206ad9a57d68f6.tar.gz
CMake-64e97edad7c8d4b8a2585067db206ad9a57d68f6.tar.bz2
Merge topic 'ninja-require-byproducts'
bd9c7f9b Ninja: Add policy to require explicit custom command byproducts ed8e30b0 cmGlobalNinjaGenerator: Optimize handling of known build outputs ad094f43 cmGlobalNinjaGenerator: Fix spelling of "unknown" 82a37d3c cmGlobalNinjaGenerator: Drop unused member
Diffstat (limited to 'Tests/RunCMake/Ninja')
-rw-r--r--Tests/RunCMake/Ninja/CMP0058-NEW-by-build-stdout.txt4
-rw-r--r--Tests/RunCMake/Ninja/CMP0058-NEW-by.cmake3
-rw-r--r--Tests/RunCMake/Ninja/CMP0058-NEW-no-build-result.txt1
-rw-r--r--Tests/RunCMake/Ninja/CMP0058-NEW-no-build-stderr.txt1
-rw-r--r--Tests/RunCMake/Ninja/CMP0058-NEW-no.cmake2
-rw-r--r--Tests/RunCMake/Ninja/CMP0058-OLD-by-build-stdout.txt4
-rw-r--r--Tests/RunCMake/Ninja/CMP0058-OLD-by.cmake3
-rw-r--r--Tests/RunCMake/Ninja/CMP0058-OLD-no-build-stdout.txt4
-rw-r--r--Tests/RunCMake/Ninja/CMP0058-OLD-no.cmake2
-rw-r--r--Tests/RunCMake/Ninja/CMP0058-WARN-by-build-stdout.txt4
-rw-r--r--Tests/RunCMake/Ninja/CMP0058-WARN-by.cmake2
-rw-r--r--Tests/RunCMake/Ninja/CMP0058-WARN-no-build-stdout.txt4
-rw-r--r--Tests/RunCMake/Ninja/CMP0058-WARN-no-stderr.txt19
-rw-r--r--Tests/RunCMake/Ninja/CMP0058-WARN-no.cmake1
-rw-r--r--Tests/RunCMake/Ninja/CMP0058-common.cmake17
-rw-r--r--Tests/RunCMake/Ninja/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/Ninja/RunCMakeTest.cmake18
17 files changed, 92 insertions, 0 deletions
diff --git a/Tests/RunCMake/Ninja/CMP0058-NEW-by-build-stdout.txt b/Tests/RunCMake/Ninja/CMP0058-NEW-by-build-stdout.txt
new file mode 100644
index 0000000..8646a13
--- /dev/null
+++ b/Tests/RunCMake/Ninja/CMP0058-NEW-by-build-stdout.txt
@@ -0,0 +1,4 @@
+^[^
+]* Generating output1
+[^
+]* Generating output2$
diff --git a/Tests/RunCMake/Ninja/CMP0058-NEW-by.cmake b/Tests/RunCMake/Ninja/CMP0058-NEW-by.cmake
new file mode 100644
index 0000000..0f77930
--- /dev/null
+++ b/Tests/RunCMake/Ninja/CMP0058-NEW-by.cmake
@@ -0,0 +1,3 @@
+cmake_policy(SET CMP0058 NEW)
+set(byproducts BYPRODUCTS byproduct1a byproduct1b)
+include(CMP0058-common.cmake)
diff --git a/Tests/RunCMake/Ninja/CMP0058-NEW-no-build-result.txt b/Tests/RunCMake/Ninja/CMP0058-NEW-no-build-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Ninja/CMP0058-NEW-no-build-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Ninja/CMP0058-NEW-no-build-stderr.txt b/Tests/RunCMake/Ninja/CMP0058-NEW-no-build-stderr.txt
new file mode 100644
index 0000000..fa10109
--- /dev/null
+++ b/Tests/RunCMake/Ninja/CMP0058-NEW-no-build-stderr.txt
@@ -0,0 +1 @@
+ninja: error: 'byproduct1a', needed by 'output2', missing and no known rule to make it
diff --git a/Tests/RunCMake/Ninja/CMP0058-NEW-no.cmake b/Tests/RunCMake/Ninja/CMP0058-NEW-no.cmake
new file mode 100644
index 0000000..582e3d5
--- /dev/null
+++ b/Tests/RunCMake/Ninja/CMP0058-NEW-no.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0058 NEW)
+include(CMP0058-common.cmake)
diff --git a/Tests/RunCMake/Ninja/CMP0058-OLD-by-build-stdout.txt b/Tests/RunCMake/Ninja/CMP0058-OLD-by-build-stdout.txt
new file mode 100644
index 0000000..8646a13
--- /dev/null
+++ b/Tests/RunCMake/Ninja/CMP0058-OLD-by-build-stdout.txt
@@ -0,0 +1,4 @@
+^[^
+]* Generating output1
+[^
+]* Generating output2$
diff --git a/Tests/RunCMake/Ninja/CMP0058-OLD-by.cmake b/Tests/RunCMake/Ninja/CMP0058-OLD-by.cmake
new file mode 100644
index 0000000..92a3a0f
--- /dev/null
+++ b/Tests/RunCMake/Ninja/CMP0058-OLD-by.cmake
@@ -0,0 +1,3 @@
+cmake_policy(SET CMP0058 OLD)
+set(byproducts BYPRODUCTS byproduct1a byproduct1b)
+include(CMP0058-common.cmake)
diff --git a/Tests/RunCMake/Ninja/CMP0058-OLD-no-build-stdout.txt b/Tests/RunCMake/Ninja/CMP0058-OLD-no-build-stdout.txt
new file mode 100644
index 0000000..8646a13
--- /dev/null
+++ b/Tests/RunCMake/Ninja/CMP0058-OLD-no-build-stdout.txt
@@ -0,0 +1,4 @@
+^[^
+]* Generating output1
+[^
+]* Generating output2$
diff --git a/Tests/RunCMake/Ninja/CMP0058-OLD-no.cmake b/Tests/RunCMake/Ninja/CMP0058-OLD-no.cmake
new file mode 100644
index 0000000..0326e07
--- /dev/null
+++ b/Tests/RunCMake/Ninja/CMP0058-OLD-no.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0058 OLD)
+include(CMP0058-common.cmake)
diff --git a/Tests/RunCMake/Ninja/CMP0058-WARN-by-build-stdout.txt b/Tests/RunCMake/Ninja/CMP0058-WARN-by-build-stdout.txt
new file mode 100644
index 0000000..8646a13
--- /dev/null
+++ b/Tests/RunCMake/Ninja/CMP0058-WARN-by-build-stdout.txt
@@ -0,0 +1,4 @@
+^[^
+]* Generating output1
+[^
+]* Generating output2$
diff --git a/Tests/RunCMake/Ninja/CMP0058-WARN-by.cmake b/Tests/RunCMake/Ninja/CMP0058-WARN-by.cmake
new file mode 100644
index 0000000..6128167
--- /dev/null
+++ b/Tests/RunCMake/Ninja/CMP0058-WARN-by.cmake
@@ -0,0 +1,2 @@
+set(byproducts BYPRODUCTS byproduct1a byproduct1b)
+include(CMP0058-common.cmake)
diff --git a/Tests/RunCMake/Ninja/CMP0058-WARN-no-build-stdout.txt b/Tests/RunCMake/Ninja/CMP0058-WARN-no-build-stdout.txt
new file mode 100644
index 0000000..8646a13
--- /dev/null
+++ b/Tests/RunCMake/Ninja/CMP0058-WARN-no-build-stdout.txt
@@ -0,0 +1,4 @@
+^[^
+]* Generating output1
+[^
+]* Generating output2$
diff --git a/Tests/RunCMake/Ninja/CMP0058-WARN-no-stderr.txt b/Tests/RunCMake/Ninja/CMP0058-WARN-no-stderr.txt
new file mode 100644
index 0000000..439a2d9
--- /dev/null
+++ b/Tests/RunCMake/Ninja/CMP0058-WARN-no-stderr.txt
@@ -0,0 +1,19 @@
+^CMake Warning \(dev\):
+ Policy CMP0058 is not set: Ninja requires custom command byproducts to be
+ explicit. Run "cmake --help-policy CMP0058" for policy details. Use the
+ cmake_policy command to set the policy and suppress this warning.
+
+ This project specifies custom command DEPENDS on files in the build tree
+ that are not specified as the OUTPUT or BYPRODUCTS of any
+ add_custom_command or add_custom_target:
+
+ byproduct1a
+ byproduct1b
+
+ For compatibility with versions of CMake that did not have the BYPRODUCTS
+ option, CMake is generating phony rules for such files to convince 'ninja'
+ to build.
+
+ Project authors should add the missing BYPRODUCTS or OUTPUT options to the
+ custom commands that produce these files.
+This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/Ninja/CMP0058-WARN-no.cmake b/Tests/RunCMake/Ninja/CMP0058-WARN-no.cmake
new file mode 100644
index 0000000..7bc66ef
--- /dev/null
+++ b/Tests/RunCMake/Ninja/CMP0058-WARN-no.cmake
@@ -0,0 +1 @@
+include(CMP0058-common.cmake)
diff --git a/Tests/RunCMake/Ninja/CMP0058-common.cmake b/Tests/RunCMake/Ninja/CMP0058-common.cmake
new file mode 100644
index 0000000..9274d58
--- /dev/null
+++ b/Tests/RunCMake/Ninja/CMP0058-common.cmake
@@ -0,0 +1,17 @@
+add_custom_command(
+ OUTPUT output1
+ ${byproducts}
+ COMMAND ${CMAKE_COMMAND} -E touch output1
+ COMMAND ${CMAKE_COMMAND} -E touch byproduct1a
+ COMMAND ${CMAKE_COMMAND} -E touch byproduct1b
+ )
+add_custom_target(Drive1 ALL DEPENDS output1)
+add_custom_command(
+ OUTPUT output2
+ COMMAND ${CMAKE_COMMAND} -E copy output1 output2
+ DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/output1
+ ${CMAKE_CURRENT_BINARY_DIR}/byproduct1a
+ ${CMAKE_CURRENT_BINARY_DIR}/byproduct1b
+ )
+add_custom_target(Drive2 ALL DEPENDS output2)
+add_dependencies(Drive2 Drive1)
diff --git a/Tests/RunCMake/Ninja/CMakeLists.txt b/Tests/RunCMake/Ninja/CMakeLists.txt
new file mode 100644
index 0000000..2a0591e
--- /dev/null
+++ b/Tests/RunCMake/Ninja/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.2)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake NO_POLICY_SCOPE)
diff --git a/Tests/RunCMake/Ninja/RunCMakeTest.cmake b/Tests/RunCMake/Ninja/RunCMakeTest.cmake
new file mode 100644
index 0000000..64f97bc
--- /dev/null
+++ b/Tests/RunCMake/Ninja/RunCMakeTest.cmake
@@ -0,0 +1,18 @@
+include(RunCMake)
+
+function(run_CMP0058 case)
+ # Use a single build tree for a few tests without cleaning.
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/CMP0058-${case}-build)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+ file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+ run_cmake(CMP0058-${case})
+ run_cmake_command(CMP0058-${case}-build ${CMAKE_COMMAND} --build .)
+endfunction()
+
+run_CMP0058(OLD-no)
+run_CMP0058(OLD-by)
+run_CMP0058(WARN-no)
+run_CMP0058(WARN-by)
+run_CMP0058(NEW-no)
+run_CMP0058(NEW-by)