How guillaumelaurin/cest works
Cest is a header-only C++20 testing library. A test author declares suites, cases, hooks, and expectations through the public API; the Runner executes registered tests and reports pass, failure, and skip results. Matchers raise assertion errors that the Runner handles. Separate mocking capabilities provide call-recording dependency mocks and runtime function or method patching. The sampled source is partial, so the graph omits uncertain internal wiring; README capabilities such as custom matchers and lifecycle hooks are included where documented.
Main entry points: core.hpp Runner · mock.hpp MockFn · hot_patch.hpp Function patching · hot_patch_method.hpp Method patching
Components 16
Test execution
- Suite DSL
include/cest/core.hpp - Runner
include/cest/core.hpp - Lifecycle hooks
include/cest/core.hpp - Test cases
include/cest/core.hpp - Test report
include/cest/core.hpp
Assertions
- Expect API
include/cest/core.hpp - Matchers
include/cest/core.hpp - Assertion errors
include/cest/core.hpp
Mocking
- MockFn
include/cest/mocks/mock.hpp - Call state
include/cest/mocks/mock.hpp - Mock matchers
include/cest/mocks/mock.hpp - Function patching
include/cest/mocks/hot_patch.hpp - Method patching
include/cest/mocks/hot_patch_method.hpp - Patch guard
include/cest/mocks/hot_patch.hpp
Other components
- Test author
- Terminal
Connections 18
- Test author → Suite DSL: declares suites
- Suite DSL → Runner: registers tests
- Test author → Expect API: writes expectations
- Expect API → Matchers: creates matcher
- Matchers → Assertion errors: throws on failure
- Runner → Lifecycle hooks: runs hooks
- Runner → Test cases: runs cases
- Runner → Assertion errors: catches failures
- Runner → Test report: formats results
- Test report → Terminal: writes output
- Test author → MockFn: configures or calls
- MockFn → Call state: records calls
- Test author → Mock matchers: checks calls
- Mock matchers → MockFn: queries calls
- Test author → Function patching: patches functions
- Function patching → Patch guard: returns guard
- Test author → Method patching: patches methods
- Method patching → Patch guard: returns guard