diff options
author | Brad King <brad.king@kitware.com> | 2019-11-04 15:24:05 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-11-04 15:24:31 (GMT) |
commit | abac3a31a2caba00e56db917cebaae8e47ffeefd (patch) | |
tree | e29048984d6c30f5cc37a4b6e8af244328b7efe3 /Tests | |
parent | b30701f04500b44810ec1413fe787a0c88a98c41 (diff) | |
parent | 0692eaf0fe00fd4bd90c2a4f107356b2bc0f9d99 (diff) | |
download | CMake-abac3a31a2caba00e56db917cebaae8e47ffeefd.zip CMake-abac3a31a2caba00e56db917cebaae8e47ffeefd.tar.gz CMake-abac3a31a2caba00e56db917cebaae8e47ffeefd.tar.bz2 |
Merge topic 'root-dir-assertion-fix'
0692eaf0fe ForceToRelativePath: Fix spurious assertion when local path is root dir
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3976
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/RunCMake/message/RunCMakeTest.cmake | 9 | ||||
-rw-r--r-- | Tests/RunCMake/message/warnmessage-rootdir-stderr.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/message/warnmessage-rootdir.cmake | 5 |
3 files changed, 15 insertions, 0 deletions
diff --git a/Tests/RunCMake/message/RunCMakeTest.cmake b/Tests/RunCMake/message/RunCMakeTest.cmake index bf6a47e..94f9e62 100644 --- a/Tests/RunCMake/message/RunCMakeTest.cmake +++ b/Tests/RunCMake/message/RunCMakeTest.cmake @@ -5,6 +5,15 @@ run_cmake(nomessage) run_cmake(message-internal-warning) run_cmake(nomessage-internal-warning) run_cmake(warnmessage) + +# Have to explicitly give the command for the working dir to be honoured +set(RunCMake_TEST_COMMAND_WORKING_DIRECTORY /) +run_cmake_command( + warnmessage-rootdir + ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/warnmessage-rootdir.cmake + ) +unset(RunCMake_TEST_COMMAND_WORKING_DIRECTORY) + # message command sets fatal occurred flag, so check each type of error # separately diff --git a/Tests/RunCMake/message/warnmessage-rootdir-stderr.txt b/Tests/RunCMake/message/warnmessage-rootdir-stderr.txt new file mode 100644 index 0000000..19d9398 --- /dev/null +++ b/Tests/RunCMake/message/warnmessage-rootdir-stderr.txt @@ -0,0 +1 @@ +We expect to see this warning message diff --git a/Tests/RunCMake/message/warnmessage-rootdir.cmake b/Tests/RunCMake/message/warnmessage-rootdir.cmake new file mode 100644 index 0000000..f82efb9 --- /dev/null +++ b/Tests/RunCMake/message/warnmessage-rootdir.cmake @@ -0,0 +1,5 @@ +cmake_minimum_required(VERSION 3.15) + +# Generating the backtrace for this warning message used to trigger a +# spurious assertion when the current directory is the root directory +message(WARNING "We expect to see this warning message") |