add tests to CTest configuration
Hi! Thanks for submitting this. What is the SPLIT_TESTS variable? Is that some standard CMake thing?
Hi,
GTest provides a macro gtest_discover_tests which creates individual CTest per GTest test (declared by TEST C++ macro) embedded into a test binary. This can be useful when running tests locally to more easily inspect granular results, especially integrating with UI. When developing I found it useful to split tests up in this way.
However, there is a downside. When running all tests, this approach is slower, since each test executes the test binary with the filter to select just a single test. Therefore, it is not really appropriate for CI, where the goal is to run all tests as quickly as possible.
Hence, I introduced SPLIT_TESTS variable to handle both of these cases. Perhaps it should be an option with a help message.
I found this useful locally, so thought I would share it. Feel free to discard this PR.