polyscope icon indicating copy to clipboard operation
polyscope copied to clipboard

add tests to CTest configuration

Open gkoulin opened this issue 1 year ago • 2 comments

gkoulin avatar Oct 01 '24 07:10 gkoulin

Hi! Thanks for submitting this. What is the SPLIT_TESTS variable? Is that some standard CMake thing?

nmwsharp avatar Apr 02 '25 08:04 nmwsharp

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.

gkoulin avatar Apr 29 '25 07:04 gkoulin