New `discover_tests` command

I would like to get more eyes on my prototype for a new discover_tests() command.

The full signature is as follows:

discover_tests(COMMAND <command> [<arg>...]
  [CONFIGURATIONS <config>...]
  DISCOVERY_ARGS <arg>...
  DISCOVERY_MATCH <regex>
  [DISCOVERY_TIMEOUT <seconds>]
  TEST_NAME <replacement>
  TEST_ARGS <replacement>...
  [PROPERTIES <key> <replacement> [<key> <replacement>]...]
  [WORKING_DIRECTORY <dir>]
  [COMMAND_EXPAND_LISTS]
)

More documentation is in my branch. Here is a repository with examples for various testing frameworks: GitHub - purpleKarrot/cmake-discover-tests

I would like to have more discussion about the design before I proceed with tests and better error handling.

1 Like

I love this idea, it would be quite a useful addition!

Discussion here: https://gitlab.kitware.com/cmake/cmake/-/issues/26920

1 Like