mirror of
https://github.com/Kitware/CMake.git
synced 2026-06-24 08:47:59 +00:00
Apply necessary manual updates to tests to account for changes made by
the introduction of the new diagnostic system. These mainly take three
forms. First, expected output changes that were not caught by the
automated changes made by the previous commit. Second, deprecation
warnings from -Wno-dev which are remedied by replacing uses thereof with
the new -Wno-author form. Third, manipulations of diagnostic state via
the old variables, which are replaced with use of the `cmake_diagnostic`
command.
We have not yet implemented backwards compatibility for the deprecated
`CMAKE_{WARN,ERROR}_DEPRECATED` variables. Once that is done, some of
the tests in the third category will likely reappear in some form.
31 lines
880 B
CMake
31 lines
880 B
CMake
execute_process(
|
|
COMMAND ${CMAKE_COMMAND} -P
|
|
"@CMAKE_CURRENT_SOURCE_DIR@/MessageTestScript.cmake"
|
|
OUTPUT_VARIABLE out
|
|
ERROR_VARIABLE err
|
|
RESULT_VARIABLE result
|
|
)
|
|
|
|
message("out=[${out}]")
|
|
message("err=[${err}]")
|
|
|
|
if(NOT "${result}" STREQUAL "0")
|
|
message(FATAL_ERROR "message script failed: [${result}]")
|
|
endif()
|
|
|
|
if(NOT "${out}" MATCHES "message-status")
|
|
message(FATAL_ERROR "message(STATUS) did not go to stdout")
|
|
endif()
|
|
|
|
if(NOT "${err}" MATCHES "message-default")
|
|
message(FATAL_ERROR "message() did not go to stderr by default")
|
|
endif()
|
|
|
|
if(NOT "${err}" MATCHES "CMake Warning at[^\n]*:\r?\n message-warning")
|
|
message(FATAL_ERROR "message(WARNING) did not appear properly")
|
|
endif()
|
|
|
|
if(NOT "${err}" MATCHES "CMake Warning \\(author\\) at[^\n]*:\r?\n message-author")
|
|
message(FATAL_ERROR "message(AUTHOR_WARNING) did not appear properly")
|
|
endif()
|