I manage a quite large open-source project with many unit-tests (~200 files) and passing all tests is quite time consuming for the continuous integration. We use cmake/ctest/Catch2 for the unit-test framework.

Is there a way to tell cmake/ctest to only build and run a random subset of the unit tests (e.g. just 30%) ?

When iterating with several commits on the code for a given feature, the probability that all tests where checked tends to one, but each individual commit would be way faster.

Obviously, this ratio would be set to 100% when preparing a PR or a release.