summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorCraig Scott <craig.scott@crascit.com>2019-11-04 19:11:32 (GMT)
committerKitware Robot <kwrobot@kitware.com>2019-11-04 19:11:45 (GMT)
commit96679969230112d52b6061d6d7523c7c24893255 (patch)
tree8e8f7d3601e43d81be950eeafd7e769756dfa1b8 /Tests
parentdbd14ecacf9b85dcdf5f566538167261dba224fe (diff)
parent7b2dd9dedc8195d2b3bc493dd5ab48cdd2fc3a7b (diff)
downloadCMake-96679969230112d52b6061d6d7523c7c24893255.zip
CMake-96679969230112d52b6061d6d7523c7c24893255.tar.gz
CMake-96679969230112d52b6061d6d7523c7c24893255.tar.bz2
Merge topic 'message-check-types'
7b2dd9dedc Refactor: Use added message types in various modules 949a1e120a message: New message types to mark checks performed by CMake Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3689
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/message/RunCMakeTest.cmake5
-rw-r--r--Tests/RunCMake/message/message-checks-stderr.txt3
-rw-r--r--Tests/RunCMake/message/message-checks-stdout.txt10
-rw-r--r--Tests/RunCMake/message/message-checks.cmake13
4 files changed, 31 insertions, 0 deletions
diff --git a/Tests/RunCMake/message/RunCMakeTest.cmake b/Tests/RunCMake/message/RunCMakeTest.cmake
index 94f9e62..0313ed1 100644
--- a/Tests/RunCMake/message/RunCMakeTest.cmake
+++ b/Tests/RunCMake/message/RunCMakeTest.cmake
@@ -92,3 +92,8 @@ run_cmake_command(
message-context-cli-wins-cache
${CMAKE_COMMAND} --log-level=verbose --log-context -DCMAKE_MESSAGE_CONTEXT_SHOW=OFF -P ${RunCMake_SOURCE_DIR}/message-context.cmake
)
+
+run_cmake_command(
+ message-checks
+ ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/message-checks.cmake
+ )
diff --git a/Tests/RunCMake/message/message-checks-stderr.txt b/Tests/RunCMake/message/message-checks-stderr.txt
new file mode 100644
index 0000000..fdacdb2
--- /dev/null
+++ b/Tests/RunCMake/message/message-checks-stderr.txt
@@ -0,0 +1,3 @@
+^CMake Warning \(dev\) at.*/Tests/RunCMake/message/message-checks.cmake:13 \(message\):
+ Ignored CHECK_FAIL without CHECK_START
+This warning is for project developers. Use -Wno-dev to suppress it.$
diff --git a/Tests/RunCMake/message/message-checks-stdout.txt b/Tests/RunCMake/message/message-checks-stdout.txt
new file mode 100644
index 0000000..4f5f2ef
--- /dev/null
+++ b/Tests/RunCMake/message/message-checks-stdout.txt
@@ -0,0 +1,10 @@
+-- Find `libfoo`
+-- Looking for `libfoo\.h`
+-- Looking for `libfoo\.h` - found \[/usr/include\]
+-- Looking for `libfoo\.so`
+-- Looking for `libfoo\.so` - found \[/usr/lib/libfoo\.so\]
+-- Getting `libfoo` version
+-- Looking for `libfoo/version\.h`
+-- Looking for `libfoo/version\.h` - found
+-- Getting `libfoo` version - 1\.2\.3
+-- Find `libfoo` - required version 4\.5\.6 but found 1\.2\.3
diff --git a/Tests/RunCMake/message/message-checks.cmake b/Tests/RunCMake/message/message-checks.cmake
new file mode 100644
index 0000000..605846e
--- /dev/null
+++ b/Tests/RunCMake/message/message-checks.cmake
@@ -0,0 +1,13 @@
+message(CHECK_START "Find `libfoo`")
+message(CHECK_START "Looking for `libfoo.h`")
+message(CHECK_PASS "found [/usr/include]")
+message(CHECK_START "Looking for `libfoo.so`")
+message(CHECK_PASS "found [/usr/lib/libfoo.so]")
+message(CHECK_START "Getting `libfoo` version")
+message(CHECK_START "Looking for `libfoo/version.h`")
+message(CHECK_PASS "found")
+message(CHECK_PASS "1.2.3")
+message(CHECK_FAIL "required version 4.5.6 but found 1.2.3")
+
+# Should generate an error, no associated CHECK_START
+message(CHECK_FAIL "unmatched check fail case")