diff options
author | Ashish Sadanandan <ashish.sadanandan@gmail.com> | 2021-07-26 16:44:21 (GMT) |
---|---|---|
committer | Ashish Sadanandan <ashish.sadanandan@gmail.com> | 2021-08-05 06:43:17 (GMT) |
commit | ea6a7dd1c2e76533d6aa4725e04acc3d8e1ed912 (patch) | |
tree | 727cb24ff45ab42d2a00ce5aeab016363a25c327 /Modules/GoogleTest.cmake | |
parent | 6c0f476505166c3aed414c7707b92c68e278f9b3 (diff) | |
download | CMake-ea6a7dd1c2e76533d6aa4725e04acc3d8e1ed912.zip CMake-ea6a7dd1c2e76533d6aa4725e04acc3d8e1ed912.tar.gz CMake-ea6a7dd1c2e76533d6aa4725e04acc3d8e1ed912.tar.bz2 |
GoogleTest: Add TEST_FILTER arg to gtest_discover_tests
The `TEST_FILTER` argument can be used to filter tests during the
discovery phase. It combines `--gtest_filter=<expr>` with the
`--gtest_list_tests` argument when invoking the test excutable for
listing defined tests.
Fixes: #17493
Diffstat (limited to 'Modules/GoogleTest.cmake')
-rw-r--r-- | Modules/GoogleTest.cmake | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Modules/GoogleTest.cmake b/Modules/GoogleTest.cmake index 80d8e23..a483c03 100644 --- a/Modules/GoogleTest.cmake +++ b/Modules/GoogleTest.cmake @@ -151,6 +151,7 @@ same as the Google Test name (i.e. ``suite.testcase``); see also [WORKING_DIRECTORY dir] [TEST_PREFIX prefix] [TEST_SUFFIX suffix] + [TEST_FILTER expr] [NO_PRETTY_TYPES] [NO_PRETTY_VALUES] [PROPERTIES name1 value1...] [TEST_LIST var] @@ -204,6 +205,12 @@ same as the Google Test name (i.e. ``suite.testcase``); see also every discovered test case. Both ``TEST_PREFIX`` and ``TEST_SUFFIX`` may be specified. + ``TEST_FILTER expr`` + .. versionadded:: 3.22 + + Filter expression to pass to ``--gtest_filter`` argument during test + discovery. + ``NO_PRETTY_TYPES`` By default, the type index of type-parameterized tests is replaced by the actual type name in the CTest test name. If this behavior is undesirable @@ -411,7 +418,7 @@ function(gtest_discover_tests TARGET) "" "NO_PRETTY_TYPES;NO_PRETTY_VALUES" "TEST_PREFIX;TEST_SUFFIX;WORKING_DIRECTORY;TEST_LIST;DISCOVERY_TIMEOUT;XML_OUTPUT_DIR;DISCOVERY_MODE" - "EXTRA_ARGS;PROPERTIES" + "EXTRA_ARGS;PROPERTIES;TEST_FILTER" ${ARGN} ) @@ -475,6 +482,7 @@ function(gtest_discover_tests TARGET) -D "TEST_PROPERTIES=${_PROPERTIES}" -D "TEST_PREFIX=${_TEST_PREFIX}" -D "TEST_SUFFIX=${_TEST_SUFFIX}" + -D "TEST_FILTER=${_TEST_FILTER}" -D "NO_PRETTY_TYPES=${_NO_PRETTY_TYPES}" -D "NO_PRETTY_VALUES=${_NO_PRETTY_VALUES}" -D "TEST_LIST=${_TEST_LIST}" @@ -515,6 +523,7 @@ function(gtest_discover_tests TARGET) " TEST_PROPERTIES" " [==[" "${_PROPERTIES}" "]==]" "\n" " TEST_PREFIX" " [==[" "${_TEST_PREFIX}" "]==]" "\n" " TEST_SUFFIX" " [==[" "${_TEST_SUFFIX}" "]==]" "\n" + " TEST_FILTER" " [==[" "${_TEST_FILTER}" "]==]" "\n" " NO_PRETTY_TYPES" " [==[" "${_NO_PRETTY_TYPES}" "]==]" "\n" " NO_PRETTY_VALUES" " [==[" "${_NO_PRETTY_VALUES}" "]==]" "\n" " TEST_LIST" " [==[" "${_TEST_LIST}" "]==]" "\n" |