summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/message
diff options
context:
space:
mode:
authorMichael Scott <michael.scott250@gmail.com>2015-11-08 12:20:47 (GMT)
committerBrad King <brad.king@kitware.com>2015-11-30 20:00:08 (GMT)
commitdeec3a3f06d341cfe0bef4e856b263eff347cc72 (patch)
tree3eb1f0268a400ea4fd0573c6431825ecaa0b392c /Tests/RunCMake/message
parentaa427a4239eb691d4129ebc383ab7b0d61b5b94e (diff)
downloadCMake-deec3a3f06d341cfe0bef4e856b263eff347cc72.zip
CMake-deec3a3f06d341cfe0bef4e856b263eff347cc72.tar.gz
CMake-deec3a3f06d341cfe0bef4e856b263eff347cc72.tar.bz2
Make message suppression more consistent.
Make the message suppression more consistent, by adding a check for the message related CMake variables in cmake::IssueMessage, which allows callers of IssueMessage other than the message command to behave as expected. Also added a check for CMAKE_SUPPRESS_DEVELOPER_WARNINGS in the message command to mirror the deprecated message type behaviour. Added a 'force' flag to the cmake::IssueMessage method, to make the message suppression consistent, when setting the message related CMake variables directly in a CMake file. Expand message command tests to cover the AUTHOR_WARNING message type as well.
Diffstat (limited to 'Tests/RunCMake/message')
-rw-r--r--Tests/RunCMake/message/nomessage.cmake4
-rw-r--r--Tests/RunCMake/message/warnmessage-stderr.txt11
-rw-r--r--Tests/RunCMake/message/warnmessage.cmake6
3 files changed, 18 insertions, 3 deletions
diff --git a/Tests/RunCMake/message/nomessage.cmake b/Tests/RunCMake/message/nomessage.cmake
index bcc97be..582ab4d 100644
--- a/Tests/RunCMake/message/nomessage.cmake
+++ b/Tests/RunCMake/message/nomessage.cmake
@@ -1,2 +1,6 @@
message(DEPRECATION "This is not issued")
+
+set(CMAKE_SUPPRESS_DEVELOPER_WARNINGS ON)
+
+message(AUTHOR_WARNING "This is not issued")
diff --git a/Tests/RunCMake/message/warnmessage-stderr.txt b/Tests/RunCMake/message/warnmessage-stderr.txt
index 5c44566..e60af6e 100644
--- a/Tests/RunCMake/message/warnmessage-stderr.txt
+++ b/Tests/RunCMake/message/warnmessage-stderr.txt
@@ -1,4 +1,11 @@
-CMake Deprecation Warning at warnmessage.cmake:4 \(message\):
- This is a warning
+^CMake Deprecation Warning at warnmessage.cmake:4 \(message\):
+ This is a deprecation warning
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
+
+
+CMake Warning \(dev\) at warnmessage.cmake:8 \(message\):
+ This is a author warning
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.$
diff --git a/Tests/RunCMake/message/warnmessage.cmake b/Tests/RunCMake/message/warnmessage.cmake
index 4c421a1..53f2a43 100644
--- a/Tests/RunCMake/message/warnmessage.cmake
+++ b/Tests/RunCMake/message/warnmessage.cmake
@@ -1,4 +1,8 @@
set(CMAKE_WARN_DEPRECATED ON)
-message(DEPRECATION "This is a warning")
+message(DEPRECATION "This is a deprecation warning")
+
+set(CMAKE_SUPPRESS_DEVELOPER_WARNINGS OFF)
+
+message(AUTHOR_WARNING "This is a author warning")