-
Book Overview & Buying
-
Table Of Contents
Minimal CMake
By :
Before we begin looking at the details of adding CTest to our existing CMakeLists.txt files and using the ctest command-line application, it’s important to understand what CTest is, and, perhaps more importantly, what it is not.
There are two components to CTest: the CTest module that is included in our existing CMakeLists.txt files, used to describe and add tests, and the ctest command-line interface (CLI), which is used to run the tests after they have been compiled. CTest is not itself a language-specific testing library. It is perfectly reasonable to add tests to a project created with CMake without using CTest at all (for example, by creating a separate test executable that depends on a well-known testing library, such as Google Test (https://github.com/google/googletest) or Catch2 (https://github.com/catchorg/Catch2). CTest is not a substitute for one of these libraries that provide excellent support for writing unit and integration style tests.