summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2013-09-17 16:54:34 (GMT)
committerStephen Kelly <steveire@gmail.com>2013-10-08 16:11:22 (GMT)
commit509c142a3f5ae4c1aa8dfcb4257c63a9e1edc270 (patch)
treea40f496e40a0d6175e5b6c553ab5c3c004a4bba8 /Tests
parent40c84683aafc9447a0e17d81a71d061efde84bdb (diff)
downloadCMake-509c142a3f5ae4c1aa8dfcb4257c63a9e1edc270.zip
CMake-509c142a3f5ae4c1aa8dfcb4257c63a9e1edc270.tar.gz
CMake-509c142a3f5ae4c1aa8dfcb4257c63a9e1edc270.tar.bz2
message: Add a DEPRECATION mode
By default, the message is not issued. If CMAKE_ERROR_DEPRECATED is on, the message is fatal. If CMAKE_WARN_DEPRECATED is on, the message is a warning.
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/CMakeLists.txt1
-rw-r--r--Tests/RunCMake/message/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/message/RunCMakeTest.cmake5
-rw-r--r--Tests/RunCMake/message/errormessage-result.txt1
-rw-r--r--Tests/RunCMake/message/errormessage-stderr.txt4
-rw-r--r--Tests/RunCMake/message/errormessage.cmake4
-rw-r--r--Tests/RunCMake/message/nomessage-result.txt1
-rw-r--r--Tests/RunCMake/message/nomessage-stderr.txt1
-rw-r--r--Tests/RunCMake/message/nomessage.cmake2
-rw-r--r--Tests/RunCMake/message/warnmessage-result.txt1
-rw-r--r--Tests/RunCMake/message/warnmessage-stderr.txt4
-rw-r--r--Tests/RunCMake/message/warnmessage.cmake4
12 files changed, 31 insertions, 0 deletions
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index ee490b8..4fbc3b0 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -95,6 +95,7 @@ add_RunCMake_test(if)
add_RunCMake_test(include)
add_RunCMake_test(include_directories)
add_RunCMake_test(list)
+add_RunCMake_test(message)
add_RunCMake_test(try_compile)
add_RunCMake_test(variable_watch)
add_RunCMake_test(CMP0004)
diff --git a/Tests/RunCMake/message/CMakeLists.txt b/Tests/RunCMake/message/CMakeLists.txt
new file mode 100644
index 0000000..12cd3c7
--- /dev/null
+++ b/Tests/RunCMake/message/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 2.8.4)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/message/RunCMakeTest.cmake b/Tests/RunCMake/message/RunCMakeTest.cmake
new file mode 100644
index 0000000..d2bc0c3
--- /dev/null
+++ b/Tests/RunCMake/message/RunCMakeTest.cmake
@@ -0,0 +1,5 @@
+include(RunCMake)
+
+run_cmake(nomessage)
+run_cmake(warnmessage)
+run_cmake(errormessage)
diff --git a/Tests/RunCMake/message/errormessage-result.txt b/Tests/RunCMake/message/errormessage-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/message/errormessage-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/message/errormessage-stderr.txt b/Tests/RunCMake/message/errormessage-stderr.txt
new file mode 100644
index 0000000..49e7ca9
--- /dev/null
+++ b/Tests/RunCMake/message/errormessage-stderr.txt
@@ -0,0 +1,4 @@
+CMake Deprecation Error at errormessage.cmake:4 \(message\):
+ This is an error
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/message/errormessage.cmake b/Tests/RunCMake/message/errormessage.cmake
new file mode 100644
index 0000000..7d3b779
--- /dev/null
+++ b/Tests/RunCMake/message/errormessage.cmake
@@ -0,0 +1,4 @@
+
+set(CMAKE_ERROR_DEPRECATED ON)
+
+message(DEPRECATION "This is an error")
diff --git a/Tests/RunCMake/message/nomessage-result.txt b/Tests/RunCMake/message/nomessage-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/message/nomessage-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/message/nomessage-stderr.txt b/Tests/RunCMake/message/nomessage-stderr.txt
new file mode 100644
index 0000000..10f3293
--- /dev/null
+++ b/Tests/RunCMake/message/nomessage-stderr.txt
@@ -0,0 +1 @@
+^$
diff --git a/Tests/RunCMake/message/nomessage.cmake b/Tests/RunCMake/message/nomessage.cmake
new file mode 100644
index 0000000..bcc97be
--- /dev/null
+++ b/Tests/RunCMake/message/nomessage.cmake
@@ -0,0 +1,2 @@
+
+message(DEPRECATION "This is not issued")
diff --git a/Tests/RunCMake/message/warnmessage-result.txt b/Tests/RunCMake/message/warnmessage-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/message/warnmessage-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/message/warnmessage-stderr.txt b/Tests/RunCMake/message/warnmessage-stderr.txt
new file mode 100644
index 0000000..5c44566
--- /dev/null
+++ b/Tests/RunCMake/message/warnmessage-stderr.txt
@@ -0,0 +1,4 @@
+CMake Deprecation Warning at warnmessage.cmake:4 \(message\):
+ This is a warning
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/message/warnmessage.cmake b/Tests/RunCMake/message/warnmessage.cmake
new file mode 100644
index 0000000..4c421a1
--- /dev/null
+++ b/Tests/RunCMake/message/warnmessage.cmake
@@ -0,0 +1,4 @@
+
+set(CMAKE_WARN_DEPRECATED ON)
+
+message(DEPRECATION "This is a warning")