mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-09-25 04:09:36 +03:00
GoogleTest: Restore toleration of odd test PROPERTIES count
Prior to porting `gtest_discover_tests` to `discover_tests` it silently tolerated an unpaired property name. `discover_tests` does not support that, so remove the unpaired argument. Also add a warning to help projects avoid such usage. Fixes: #28004
This commit is contained in:
committed by
Brad King
parent
6147180017
commit
1b2f3287f7
@@ -586,6 +586,14 @@ function(gtest_discover_tests target)
|
||||
endif()
|
||||
set(arg_DISCOVERY_MODE ${CMAKE_GTEST_DISCOVER_TESTS_DISCOVERY_MODE})
|
||||
endif()
|
||||
if(arg_PROPERTIES)
|
||||
list(LENGTH arg_PROPERTIES _len_PROPERTIES)
|
||||
math(EXPR _odd_PROPERTIES "${_len_PROPERTIES} % 2")
|
||||
if(_odd_PROPERTIES)
|
||||
list(POP_BACK arg_PROPERTIES _back_PROPERTY)
|
||||
message(AUTHOR_WARNING "PROPERTIES should be key-value pairs. Ignoring unpaired key '${_back_PROPERTY}'.")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
get_property(test_launcher
|
||||
TARGET ${target}
|
||||
|
||||
Reference in New Issue
Block a user