test_utils.cmake 688 B

1234567891011121314151617181920
  1. macro(TEST variable)
  2. SET(expected "${ARGN}")
  3. if ( "${expected}" STREQUAL "UNDEFINED" )
  4. if (DEFINED ${variable})
  5. message(FATAL_ERROR "'${variable}' shall be undefined but has value '${${variable}}'")
  6. endif()
  7. elseif( "${expected}" STREQUAL "FALSE" )
  8. if (NOT ${variable} STREQUAL "FALSE")
  9. message(FATAL_ERROR "'${variable}' shall be FALSE")
  10. endif()
  11. elseif( "${expected}" STREQUAL "TRUE" )
  12. if (NOT ${variable} STREQUAL "TRUE")
  13. message(FATAL_ERROR "'${variable}' shall be TRUE")
  14. endif()
  15. else()
  16. if (NOT ${variable} STREQUAL "${expected}")
  17. message(FATAL_ERROR "'${variable}' shall be '${expected}'")
  18. endif()
  19. endif()
  20. endmacro()