Assertions
CMakeTest ships with a wide variety of assertion commands to assist test makers. These assertions function similarly to assertions in other test frameworks, where the test calls an assertion function that checks its inputs against a condition. If the assertion fails, the test is halted and is labeled as failing.
These assertions are only guaranteed to function inside of CMakeTest tests and sections. For more general purpose assertions, our sister project CMakePPLang has assertions, which can be found here.
The following assertions are available:
- cmake_test/asserts
- cmake_test/asserts/asserts
- cmake_test/asserts/defined
- cmake_test/asserts/equal
- cmake_test/asserts/file_contains
- cmake_test/asserts/file_exists
- cmake_test/asserts/library_exists
- cmake_test/asserts/list
- cmake_test/asserts/prints
- cmake_test/asserts/string
- cmake_test/asserts/target_exists
- cmake_test/asserts/target_has_property
- cmake_test/asserts/true_false