0

I have a set of tests like this :

enable_testing()

add_executable(first_test tests/first.cpp)
add_test(NAME FIRST COMMAND first_test)

add_executable(second_test tests/second.cpp)
add_test(NAME SECOND COMMAND second_test)

I want to get all of theses tests (*_test) inside a variable for other function dependencies.

For now, I have :

set(DEPENDENCIES first_test second_test)

A way to do that ?

Furlings
  • 51
  • 1
  • 8
  • In simple case you could extract list of all targets from the directory property `BUILDSYSTEM_TARGETS`. But it could be more convenient for you to define your own function (or macro) which would create an executable, add this executable to a list, and create a test for it. – Tsyvarev Mar 09 '22 at 10:32

0 Answers0