Tests: Add case covering GoogleTest odd PROPERTIES warning

Follow up commit 1b2f3287f7 (GoogleTest: Restore toleration
of odd test PROPERTIES count, 2026-07-30, v4.4.2~1^2).

Issue: #28004
This commit is contained in:
Brad King
2026-07-31 10:23:33 -04:00
parent c162d6852d
commit 89e6a0c18d
3 changed files with 17 additions and 0 deletions
@@ -0,0 +1,7 @@
^CMake Warning \(author\) at [^
]*/Modules/GoogleTest.cmake:[0-9]+ \(message\):
PROPERTIES should be key-value pairs. Ignoring unpaired key 'PROP2'.
Call Stack \(most recent call first\):
PropertiesOdd.cmake:[0-9]+ \(gtest_discover_tests\)
CMakeLists.txt:[0-9]+ \(include\)
This warning is for project developers\. Use -Wno-author to suppress it\.$
@@ -0,0 +1,8 @@
add_executable(example IMPORTED)
set_property(TARGET example PROPERTY IMPORTED_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/example)
include(GoogleTest)
gtest_discover_tests(example DISCOVERY_MODE PRE_TEST
PROPERTIES
PROP1 VAL1
PROP2 # no VAL2
)
@@ -11,6 +11,8 @@ else()
set(fs_delay 1.125)
endif()
run_cmake(PropertiesOdd)
function(run_GoogleTest DISCOVERY_MODE)
# Use a single build tree for a few tests without cleaning.
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/GoogleTest-build)