TZIVI-254: IVI needs a newer version of cmake
[profile/ivi/cmake.git] / Tests / CMakeTests / MessageTest.cmake.in
1 execute_process(
2   COMMAND ${CMAKE_COMMAND} -P
3           "@CMAKE_CURRENT_SOURCE_DIR@/MessageTestScript.cmake"
4   OUTPUT_VARIABLE out
5   ERROR_VARIABLE err
6   RESULT_VARIABLE result
7   )
8
9 message("out=[${out}]")
10 message("err=[${err}]")
11
12 if(NOT "${result}" STREQUAL "0")
13   message(FATAL_ERROR "message script failed: [${result}]")
14 endif()
15
16 if(NOT "${out}" MATCHES "message-status")
17   message(FATAL_ERROR "message(STATUS) did not go to stdout")
18 endif()
19
20 if(NOT "${err}" MATCHES "message-default")
21   message(FATAL_ERROR "message() did not go to stderr by default")
22 endif()
23
24 if(NOT "${err}" MATCHES "CMake Warning at[^\n]*:\r?\n  message-warning")
25   message(FATAL_ERROR "message(WARNING) did not appear properly")
26 endif()
27
28 if(NOT "${err}" MATCHES "CMake Warning \\(dev\\) at[^\n]*:\r?\n  message-author")
29   message(FATAL_ERROR "message(AUTHOR_WARNING) did not appear properly")
30 endif()