summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/message/RunCMakeTest.cmake
blob: cecfc7fe5261e5a854ea5031c7e4331c2282cd04 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
include(RunCMake)

run_cmake(defaultmessage)
run_cmake(nomessage)
run_cmake(message-internal-warning)
run_cmake(nomessage-internal-warning)
run_cmake(warnmessage)
# message command sets fatal occurred flag, so check each type of error

# separately
run_cmake(errormessage_deprecated)
run_cmake(errormessage_dev)

run_cmake_command(
    message-loglevel-invalid
    ${CMAKE_COMMAND} --loglevel=blah -P ${RunCMake_SOURCE_DIR}/message-all-loglevels.cmake
  )

# Checking various combinations of `message(...)` and log levels `WARNING` to `TRACE`
# - no CLI option -> `WARNING` to `STATUS` output
run_cmake_command(
    message-loglevel-default
    ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/message-all-loglevels.cmake
  )
# - Only `WARNING` output
run_cmake_command(
    message-loglevel-warning
    ${CMAKE_COMMAND} --loglevel=warning -P ${RunCMake_SOURCE_DIR}/message-all-loglevels.cmake
  )
# - Only `WARNING` and `NOTICE` output
run_cmake_command(
    message-loglevel-notice
    ${CMAKE_COMMAND} --loglevel=notice -P ${RunCMake_SOURCE_DIR}/message-all-loglevels.cmake
  )
# - `WARNING` to `STATUS` output
run_cmake_command(
    message-loglevel-status
    ${CMAKE_COMMAND} --loglevel=status -P ${RunCMake_SOURCE_DIR}/message-all-loglevels.cmake
  )
# - `WARNING` to `VERBOSE` output
run_cmake_command(
    message-loglevel-verbose
    ${CMAKE_COMMAND} --loglevel=verbose -P ${RunCMake_SOURCE_DIR}/message-all-loglevels.cmake
  )
# - `WARNING` to `DEBUG` output
run_cmake_command(
    message-loglevel-debug
    ${CMAKE_COMMAND} --loglevel=debug -P ${RunCMake_SOURCE_DIR}/message-all-loglevels.cmake
  )
# - `WARNING` to `TRACE` output
run_cmake_command(
    message-loglevel-trace
    ${CMAKE_COMMAND} --loglevel=trace -P ${RunCMake_SOURCE_DIR}/message-all-loglevels.cmake
  )