diff options
author | Brad King <brad.king@kitware.com> | 2015-11-18 15:36:41 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-11-18 15:42:55 (GMT) |
commit | b5e7b22defa353894ad999df83b90ae45f163d61 (patch) | |
tree | 4b7f1b01e274da1b78acbcf034b79093af82527f /Modules | |
parent | b4a2ada297214119647b26df8abe394cd73ca53a (diff) | |
download | CMake-b5e7b22defa353894ad999df83b90ae45f163d61.zip CMake-b5e7b22defa353894ad999df83b90ae45f163d61.tar.gz CMake-b5e7b22defa353894ad999df83b90ae45f163d61.tar.bz2 |
FindGTest: Refactor test type checks to avoid cases triggering CMP0064
Update our if() conditions to avoid CMP0064 warnings when `${test_type}`
is equal to `TEST`.
Reported-by: David T. Chen <dchen@mail.nih.gov>
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/FindGTest.cmake | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Modules/FindGTest.cmake b/Modules/FindGTest.cmake index fccf877..eb7abfd 100644 --- a/Modules/FindGTest.cmake +++ b/Modules/FindGTest.cmake @@ -124,11 +124,11 @@ function(GTEST_ADD_TESTS executable extra_args) string(REGEX MATCH "${gtest_test_type_regex}" test_type ${hit}) # Parameterized tests have a different signature for the filter - if(${test_type} STREQUAL "TEST_P") + if("x${test_type}" STREQUAL "xTEST_P") string(REGEX REPLACE ${gtest_case_name_regex} "*/\\1.\\2/*" test_name ${hit}) - elseif(${test_type} STREQUAL "TEST_F" OR ${test_type} STREQUAL "TEST") + elseif("x${test_type}" STREQUAL "xTEST_F" OR "x${test_type}" STREQUAL "xTEST") string(REGEX REPLACE ${gtest_case_name_regex} "\\1.\\2" test_name ${hit}) - elseif(${test_type} STREQUAL "TYPED_TEST") + elseif("x${test_type}" STREQUAL "xTYPED_TEST") string(REGEX REPLACE ${gtest_case_name_regex} "\\1/*.\\2" test_name ${hit}) else() message(WARNING "Could not parse GTest ${hit} for adding to CTest.") |