diff options
author | Alex Turbov <i.zaufi@gmail.com> | 2019-08-12 22:25:07 (GMT) |
---|---|---|
committer | Alex Turbov <i.zaufi@gmail.com> | 2019-11-02 12:10:09 (GMT) |
commit | 949a1e120a3c2d9ecac08f7240a27d307fad503f (patch) | |
tree | 4f8733aa95cbedf6c038f2532bdd5fcd919e05be /Tests | |
parent | 25eef45f16aa2046071d847d93314f3b843c870d (diff) | |
download | CMake-949a1e120a3c2d9ecac08f7240a27d307fad503f.zip CMake-949a1e120a3c2d9ecac08f7240a27d307fad503f.tar.gz CMake-949a1e120a3c2d9ecac08f7240a27d307fad503f.tar.bz2 |
message: New message types to mark checks performed by CMake
Closes #19638.
Co-Authored-By: Craig Scott <craig.scott@crascit.com>
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/RunCMake/message/RunCMakeTest.cmake | 5 | ||||
-rw-r--r-- | Tests/RunCMake/message/message-checks-stderr.txt | 3 | ||||
-rw-r--r-- | Tests/RunCMake/message/message-checks-stdout.txt | 10 | ||||
-rw-r--r-- | Tests/RunCMake/message/message-checks.cmake | 13 |
4 files changed, 31 insertions, 0 deletions
diff --git a/Tests/RunCMake/message/RunCMakeTest.cmake b/Tests/RunCMake/message/RunCMakeTest.cmake index bf6a47e..1f3fa12 100644 --- a/Tests/RunCMake/message/RunCMakeTest.cmake +++ b/Tests/RunCMake/message/RunCMakeTest.cmake @@ -83,3 +83,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") |