summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-08-30 13:29:40 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2016-08-30 13:29:40 (GMT)
commit918cb5b1f095cc05a8823fa218a59edf0e536384 (patch)
tree0c236ea635af778077a004e14e3bb2dd0a53adc7 /Tests/RunCMake
parent57d121fbb1f2e9e2ac0622dd4049dedc3968d894 (diff)
parent048d1adb4ede50e49dce00873a5961e424e149f9 (diff)
downloadCMake-918cb5b1f095cc05a8823fa218a59edf0e536384.zip
CMake-918cb5b1f095cc05a8823fa218a59edf0e536384.tar.gz
CMake-918cb5b1f095cc05a8823fa218a59edf0e536384.tar.bz2
Merge topic 'ninja-add_custom_command-depfile'
048d1adb add_custom_command: Add DEPFILE option for Ninja
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r--Tests/RunCMake/Make/CustomCommandDepfile-ERROR-result.txt1
-rw-r--r--Tests/RunCMake/Make/CustomCommandDepfile-ERROR-stderr.txt5
-rw-r--r--Tests/RunCMake/Make/CustomCommandDepfile-ERROR.cmake8
-rw-r--r--Tests/RunCMake/Make/RunCMakeTest.cmake2
-rw-r--r--Tests/RunCMake/Ninja/CustomCommandDepfile-check.cmake5
-rw-r--r--Tests/RunCMake/Ninja/CustomCommandDepfile.cmake11
-rw-r--r--Tests/RunCMake/Ninja/RunCMakeTest.cmake2
7 files changed, 34 insertions, 0 deletions
diff --git a/Tests/RunCMake/Make/CustomCommandDepfile-ERROR-result.txt b/Tests/RunCMake/Make/CustomCommandDepfile-ERROR-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Make/CustomCommandDepfile-ERROR-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Make/CustomCommandDepfile-ERROR-stderr.txt b/Tests/RunCMake/Make/CustomCommandDepfile-ERROR-stderr.txt
new file mode 100644
index 0000000..74d62a4
--- /dev/null
+++ b/Tests/RunCMake/Make/CustomCommandDepfile-ERROR-stderr.txt
@@ -0,0 +1,5 @@
+^CMake Error at CustomCommandDepfile-ERROR.cmake:1 \(add_custom_command\):
+ add_custom_command Option DEPFILE not supported by [^
+]+
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/Make/CustomCommandDepfile-ERROR.cmake b/Tests/RunCMake/Make/CustomCommandDepfile-ERROR.cmake
new file mode 100644
index 0000000..bad7955
--- /dev/null
+++ b/Tests/RunCMake/Make/CustomCommandDepfile-ERROR.cmake
@@ -0,0 +1,8 @@
+add_custom_command(
+ OUTPUT hello.copy.c
+ COMMAND "${CMAKE_COMMAND}" -E copy
+ "${CMAKE_CURRENT_SOURCE_DIR}/hello.c"
+ hello.copy.c
+ WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
+ DEPFILE "test.d"
+ )
diff --git a/Tests/RunCMake/Make/RunCMakeTest.cmake b/Tests/RunCMake/Make/RunCMakeTest.cmake
index c6bbd03..869d11e 100644
--- a/Tests/RunCMake/Make/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Make/RunCMakeTest.cmake
@@ -15,3 +15,5 @@ run_TargetMessages(OFF)
run_TargetMessages(VAR-ON -DCMAKE_TARGET_MESSAGES=ON)
run_TargetMessages(VAR-OFF -DCMAKE_TARGET_MESSAGES=OFF)
+
+run_cmake(CustomCommandDepfile-ERROR)
diff --git a/Tests/RunCMake/Ninja/CustomCommandDepfile-check.cmake b/Tests/RunCMake/Ninja/CustomCommandDepfile-check.cmake
new file mode 100644
index 0000000..189de64
--- /dev/null
+++ b/Tests/RunCMake/Ninja/CustomCommandDepfile-check.cmake
@@ -0,0 +1,5 @@
+set(log "${RunCMake_BINARY_DIR}/CustomCommandDepfile-build/build.ninja")
+file(READ "${log}" build_file)
+if(NOT "${build_file}" MATCHES "depfile = test\\.d")
+ set(RunCMake_TEST_FAILED "Log file:\n ${log}\ndoes not have expected line: depfile = test.d")
+endif()
diff --git a/Tests/RunCMake/Ninja/CustomCommandDepfile.cmake b/Tests/RunCMake/Ninja/CustomCommandDepfile.cmake
new file mode 100644
index 0000000..dbef2a5
--- /dev/null
+++ b/Tests/RunCMake/Ninja/CustomCommandDepfile.cmake
@@ -0,0 +1,11 @@
+add_custom_command(
+ OUTPUT hello.copy.c
+ COMMAND "${CMAKE_COMMAND}" -E copy
+ "${CMAKE_CURRENT_SOURCE_DIR}/hello.c"
+ hello.copy.c
+ WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
+ DEPFILE "test.d"
+ )
+add_custom_target(copy ALL DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/hello.copy.c")
+
+include(CheckNoPrefixSubDir.cmake)
diff --git a/Tests/RunCMake/Ninja/RunCMakeTest.cmake b/Tests/RunCMake/Ninja/RunCMakeTest.cmake
index 622c327..778f2c1 100644
--- a/Tests/RunCMake/Ninja/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Ninja/RunCMakeTest.cmake
@@ -32,6 +32,8 @@ run_CMP0058(WARN-by)
run_CMP0058(NEW-no)
run_CMP0058(NEW-by)
+run_cmake(CustomCommandDepfile)
+
function(run_SubDir)
# Use a single build tree for a few tests without cleaning.
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/SubDir-build)