summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/cmake_parse_arguments/test_utils.cmake
blob: f5425c2bcb2952f751f3d196c60dd685348c5de3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
macro(TEST variable)
  SET(expected "${ARGN}")
  if ( "${expected}" STREQUAL "UNDEFINED" )
    if (DEFINED ${variable})
      message(FATAL_ERROR "'${variable}' shall be undefined but has value '${${variable}}'")
    endif()
  elseif( "${expected}" STREQUAL "FALSE" )
    if (NOT ${variable} STREQUAL "FALSE")
      message(FATAL_ERROR "'${variable}' shall be FALSE")
    endif()
  elseif( "${expected}" STREQUAL "TRUE" )
    if (NOT ${variable} STREQUAL "TRUE")
      message(FATAL_ERROR "'${variable}' shall be TRUE")
    endif()
  else()
    if (NOT ${variable} STREQUAL "${expected}")
      message(FATAL_ERROR "'${variable}' shall be '${expected}'")
    endif()
  endif()
endmacro()