cmake/Tests/RunCMake/get_property/test_properties.cmake

25 lines
753 B
CMake
Raw Normal View History

2023-12-07 09:12:54 +01:00
function (check_test_property test prop dir)
set(dir_args)
if(dir)
set(dir_args DIRECTORY ${dir})
endif()
get_test_property("${test}" "${prop}" ${dir_args} gtp_val)
2015-04-27 22:25:09 +02:00
get_property(gp_val
2023-12-07 09:12:54 +01:00
TEST "${test}" ${dir_args}
2015-04-27 22:25:09 +02:00
PROPERTY "${prop}")
message("get_test_property: -->${gtp_val}<--")
message("get_property: -->${gp_val}<--")
endfunction ()
include(CTest)
add_test(NAME test COMMAND "${CMAKE_COMMAND}" --help)
set_tests_properties(test PROPERTIES empty "" custom value)
2023-12-07 09:12:54 +01:00
add_subdirectory(test_properties)
2015-04-27 22:25:09 +02:00
2023-12-07 09:12:54 +01:00
check_test_property(test empty "")
check_test_property(test custom "")
check_test_property(test noexist "")
check_test_property(test custom test_properties)
check_test_property(test custom ${CMAKE_BINARY_DIR}/test_properties)