|
kaycxx-test
C++ unit test framework
|
kaycxx-test is a static library containing the framework implementation and the default main() function. A test target therefore needs only test source files, the code under test, and kaycxx::test.
kaycxx::test exposes its dependencies transitively, including kaycxx::assert, kaycxx::cli, and kaycxx::term. Tests can include <kaycxx/assert.hpp> without linking the assertion library separately.
A custom test target runs the framework directly and preserves its hierarchical report.
Run it with:
--write-ctest FILE creates the specified CMake file. Inside that file, it writes one add_test entry for every unique full test description. Each CTest entry invokes the same executable with an exact escaped description pattern. This gives CTest per-test visibility while the direct test target keeps the framework's native report.
Run the discovered tests with:
Use verbose mode to see the framework output for every invocation:
Wrap the test dependency and test targets in a BUILD_TESTING condition when the project should also build without downloading or compiling test dependencies.
Tests can then be disabled while configuring the project: