diff options
author | Evgeniy Shcherbina <ixsci@pm.me> | 2022-02-09 08:26:51 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2022-02-11 14:03:40 (GMT) |
commit | 61929f936f3a834a99762aafaf79f9f1ce9cf6d6 (patch) | |
tree | 03c1e35e1de566fbc7912c07f6d2305f13e5330f /Tests/RunCMake/GoogleTest/GoogleTest-discovery-check-test-list.cmake | |
parent | a15cc7706da8f4a1833539be3f37fbc63ee20e36 (diff) | |
download | CMake-61929f936f3a834a99762aafaf79f9f1ce9cf6d6.zip CMake-61929f936f3a834a99762aafaf79f9f1ce9cf6d6.tar.gz CMake-61929f936f3a834a99762aafaf79f9f1ce9cf6d6.tar.bz2 |
GoogleTest: Fix escaping in test names
Due to add_command() being a macro it introduced excessive and
nonobvious escaping in different parts of the script. Because of
one of such places the resulting script would have an erroneous
${TEST_LIST} if the user data (in test parameters) had a semicolon.
To eliminate this non-obvious escaping, add_command() was converted
to function. Updated the escaping accordingly.
Fixes: #23059
Diffstat (limited to 'Tests/RunCMake/GoogleTest/GoogleTest-discovery-check-test-list.cmake')
-rw-r--r-- | Tests/RunCMake/GoogleTest/GoogleTest-discovery-check-test-list.cmake | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Tests/RunCMake/GoogleTest/GoogleTest-discovery-check-test-list.cmake b/Tests/RunCMake/GoogleTest/GoogleTest-discovery-check-test-list.cmake new file mode 100644 index 0000000..94169e7 --- /dev/null +++ b/Tests/RunCMake/GoogleTest/GoogleTest-discovery-check-test-list.cmake @@ -0,0 +1,6 @@ +list(LENGTH test_list_test_TESTS LIST_SIZE) +set(EXPECTED_SIZE 2) +if(NOT LIST_SIZE EQUAL ${EXPECTED_SIZE}) + message("TEST_LIST should have ${EXPECTED_SIZE} elements but it has ${LIST_SIZE}") + message("The unexpected list: [${test_list_test_TESTS}]") +endif() |