Add several get_property() tests

Add tests for some get_property() uses not covered by existing tests.
This commit is contained in:
Petr Kmoch 2012-10-03 17:09:09 +02:00 committed by Rolf Eike Beer
parent 82106e3783
commit 828d4f514d
1 changed files with 17 additions and 0 deletions

View File

@ -11,6 +11,23 @@ if (NOT FOO_FULL STREQUAL "NOTFOUND")
message(SEND_ERROR "property FOO has FULL_DOCS set to '${FOO_FULL}'") message(SEND_ERROR "property FOO has FULL_DOCS set to '${FOO_FULL}'")
endif () endif ()
get_property(test_brief GLOBAL PROPERTY ENABLED_FEATURES BRIEF_DOCS)
get_property(test_full GLOBAL PROPERTY ENABLED_FEATURES FULL_DOCS)
if(test_brief STREQUAL "NOTFOUND")
message(SEND_ERROR "property ENABLED_FEATURES has no BRIEF_DOCS")
endif()
if(test_full STREQUAL "NOTFOUND")
message(SEND_ERROR "property ENABLED_FEATURES has no FULL_DOCS")
endif()
set(test_var alpha)
get_property(result VARIABLE PROPERTY test_var)
if(NOT result STREQUAL "alpha")
message(SEND_ERROR "bad value of VARIABLE PROPERTY test_var: got '${result}' instead of 'alpha'")
endif()
set(Missing-Argument-RESULT 1) set(Missing-Argument-RESULT 1)
set(Missing-Argument-STDERR ".*CMake Error at (@CMAKE_CURRENT_SOURCE_DIR@/)?GetProperty-Missing-Argument.cmake:1 \\(get_property\\):.*get_property called with incorrect number of arguments.*") set(Missing-Argument-STDERR ".*CMake Error at (@CMAKE_CURRENT_SOURCE_DIR@/)?GetProperty-Missing-Argument.cmake:1 \\(get_property\\):.*get_property called with incorrect number of arguments.*")