summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorRuslan Baratov <ruslan_baratov@yahoo.com>2016-09-09 20:19:39 (GMT)
committerRuslan Baratov <ruslan_baratov@yahoo.com>2016-09-09 20:19:39 (GMT)
commit4dd997da541be93b0cfacdd8483eaec8dd2a76d5 (patch)
tree6e906990cdac22724553fbe4a9cf5e0be8961684 /Tests
parentd5e4cdc0f8c846cdf17f3276d77d352a7644bc88 (diff)
downloadCMake-4dd997da541be93b0cfacdd8483eaec8dd2a76d5.zip
CMake-4dd997da541be93b0cfacdd8483eaec8dd2a76d5.tar.gz
CMake-4dd997da541be93b0cfacdd8483eaec8dd2a76d5.tar.bz2
file(DOWNLOAD|UPLOAD): Warn on unexpected arguments
Emit warning message on unparsed argument instead of silently ignoring it. Can't stop with the error message because it may break old code.
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/file/DOWNLOAD-unused-argument-result.txt0
-rw-r--r--Tests/RunCMake/file/DOWNLOAD-unused-argument-stderr.txt5
-rw-r--r--Tests/RunCMake/file/DOWNLOAD-unused-argument.cmake5
-rw-r--r--Tests/RunCMake/file/DOWNLOAD-unused-argument.txt0
-rw-r--r--Tests/RunCMake/file/RunCMakeTest.cmake2
-rw-r--r--Tests/RunCMake/file/UPLOAD-unused-argument-result.txt0
-rw-r--r--Tests/RunCMake/file/UPLOAD-unused-argument-stderr.txt5
-rw-r--r--Tests/RunCMake/file/UPLOAD-unused-argument.cmake5
-rw-r--r--Tests/RunCMake/file/UPLOAD-unused-argument.txt0
9 files changed, 22 insertions, 0 deletions
diff --git a/Tests/RunCMake/file/DOWNLOAD-unused-argument-result.txt b/Tests/RunCMake/file/DOWNLOAD-unused-argument-result.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/file/DOWNLOAD-unused-argument-result.txt
diff --git a/Tests/RunCMake/file/DOWNLOAD-unused-argument-stderr.txt b/Tests/RunCMake/file/DOWNLOAD-unused-argument-stderr.txt
new file mode 100644
index 0000000..82a78c9
--- /dev/null
+++ b/Tests/RunCMake/file/DOWNLOAD-unused-argument-stderr.txt
@@ -0,0 +1,5 @@
+^CMake Warning \(dev\) at DOWNLOAD-unused-argument.cmake:[0-9]+ \(file\):
+ Unexpected argument: JUNK
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.$
diff --git a/Tests/RunCMake/file/DOWNLOAD-unused-argument.cmake b/Tests/RunCMake/file/DOWNLOAD-unused-argument.cmake
new file mode 100644
index 0000000..2e3fbe1
--- /dev/null
+++ b/Tests/RunCMake/file/DOWNLOAD-unused-argument.cmake
@@ -0,0 +1,5 @@
+file(DOWNLOAD
+ "file://${CMAKE_CURRENT_SOURCE_DIR}/DOWNLOAD-unused-argument.txt"
+ "${CMAKE_CURRENT_BINARY_DIR}/unused-argument.txt"
+ JUNK
+ )
diff --git a/Tests/RunCMake/file/DOWNLOAD-unused-argument.txt b/Tests/RunCMake/file/DOWNLOAD-unused-argument.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/file/DOWNLOAD-unused-argument.txt
diff --git a/Tests/RunCMake/file/RunCMakeTest.cmake b/Tests/RunCMake/file/RunCMakeTest.cmake
index 5f85bba..4c05f24 100644
--- a/Tests/RunCMake/file/RunCMakeTest.cmake
+++ b/Tests/RunCMake/file/RunCMakeTest.cmake
@@ -1,6 +1,8 @@
include(RunCMake)
run_cmake(DOWNLOAD-hash-mismatch)
+run_cmake(DOWNLOAD-unused-argument)
+run_cmake(UPLOAD-unused-argument)
run_cmake(INSTALL-DIRECTORY)
run_cmake(INSTALL-MESSAGE-bad)
run_cmake(FileOpenFailRead)
diff --git a/Tests/RunCMake/file/UPLOAD-unused-argument-result.txt b/Tests/RunCMake/file/UPLOAD-unused-argument-result.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/file/UPLOAD-unused-argument-result.txt
diff --git a/Tests/RunCMake/file/UPLOAD-unused-argument-stderr.txt b/Tests/RunCMake/file/UPLOAD-unused-argument-stderr.txt
new file mode 100644
index 0000000..3c1b744
--- /dev/null
+++ b/Tests/RunCMake/file/UPLOAD-unused-argument-stderr.txt
@@ -0,0 +1,5 @@
+^CMake Warning \(dev\) at UPLOAD-unused-argument.cmake:[0-9]+ \(file\):
+ Unexpected argument: JUNK
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.$
diff --git a/Tests/RunCMake/file/UPLOAD-unused-argument.cmake b/Tests/RunCMake/file/UPLOAD-unused-argument.cmake
new file mode 100644
index 0000000..94ac9ac
--- /dev/null
+++ b/Tests/RunCMake/file/UPLOAD-unused-argument.cmake
@@ -0,0 +1,5 @@
+file(UPLOAD
+ "${CMAKE_CURRENT_SOURCE_DIR}/UPLOAD-unused-argument.txt"
+ "file://${CMAKE_CURRENT_BINARY_DIR}/unused-argument.txt"
+ JUNK
+ )
diff --git a/Tests/RunCMake/file/UPLOAD-unused-argument.txt b/Tests/RunCMake/file/UPLOAD-unused-argument.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/file/UPLOAD-unused-argument.txt