CMake itselfs also provides an infrastructure to add tests to project.
There are the commands add_test and enable_testing for adding tests to a project.
And there is also a CMake test driver program called ctest.
Depending on your project structure, IDE integration and requirements when you want to run your test, the usage of ctest can be helpful.
Create your playground on Tech.io
This playground was created on Tech.io, our hands-on, knowledge-sharing platform for developers.