summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/cmake_parse_arguments/test_utils.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/RunCMake/cmake_parse_arguments/test_utils.cmake')
-rw-r--r--Tests/RunCMake/cmake_parse_arguments/test_utils.cmake20
1 files changed, 20 insertions, 0 deletions
diff --git a/Tests/RunCMake/cmake_parse_arguments/test_utils.cmake b/Tests/RunCMake/cmake_parse_arguments/test_utils.cmake
new file mode 100644
index 0000000..f5425c2
--- /dev/null
+++ b/Tests/RunCMake/cmake_parse_arguments/test_utils.cmake
@@ -0,0 +1,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()