4 Commits
Author SHA1 Message Date
Daniel Pfeifer 5e5467bfc3 GoogleTest: Revert "Base on builtin command discover_tests"
Revert commit a324c2bb58 (GoogleTest: Base on builtin command
discover_tests, 2026-03-01, v4.4.0-rc1~30^2).  The `discover_tests`
implementation does not persist already-discovered tests across ctest
runs, making it much slower on projects whose test binaries take a while
just to start up and list tests.  Revert to the prior implementation
pending caching support in `discover_tests`.

Fixes: #28053
Issue: #28060
2026-08-28 11:08:59 -04:00
Ottmar Zittlau 75634620ed GoogleTest: Fix regression with value parameters in discovered tests
Google Test returns parameter values for parametrized tests in two ways:

* As part of the test name - if a name_generator has been provided in
  the test this will be the generated string, otherwise gtest will just
  number all tests

* In a separate field of the json (or the text output) - this seems to
  be a byte representation of the input data if the input data cannot be
  converted to a string.

If the cmake parameter `NO_PRETTY_VALUES` to `gtest_discover_tests` has
not been set, the auto-generated test index - i.e. if no `name_generator
has been specified - is supposed to be replaced by the value parameter
from category 2 above. However, since commit 1cdceae8e3 (GoogleTest:
Parse discovered test list from JSON output if supported, 2025-05-02,
v4.2.0-rc1~533^2~2), the logic has been broken, in that the test suffix
is always replaced even though a name_generator has been configured.

Fix this by checking if the last part of the test name is an integer and
only then replace it.

Fixes: #27846
2026-06-08 11:14:53 -04:00
Daniel Pfeifer a324c2bb58 GoogleTest: Base on builtin command discover_tests 2026-06-02 21:19:28 +02:00
Daniel Pfeifer 6b6e9fbc32 GoogleTest: Move test list parsing to separate file 2026-06-02 21:05:05 +02:00