How surya-narayan-m/catch2 works
Catch2 is a C++ testing framework with microbenchmarking and BDD macros. A user writes tests and assertions, then runs the framework to execute selected tests and produce reports. The tree shows distinct session, configuration, registry, execution, assertion, matcher, generator, and reporter modules; the README documents the user-facing capabilities. Most implementation relationships are not established by the available excerpts or reference index, so unverified runtime links are dashed rather than presented as inspected calls.
Main entry points: catch_run_context.cpp Test execution · catch_session.cpp Session runner · catch_reporter_registry.cpp Reporter setup · catch_test_macros.hpp Test and BDD macros
Components 17
Test entry
- Test and BDD macros
src/catch2/catch_test_macros.hpp - Session runner
src/catch2/catch_session.cpp - Run configuration
src/catch2/catch_config.cpp - Amalgamated distribution
extras/catch_amalgamated.cpp
Test runtime
- Test registry
src/catch2/internal/catch_test_registry.cpp - Test selection
src/catch2/catch_test_spec.cpp - Test execution
src/catch2/internal/catch_run_context.cpp - Section tracking
src/catch2/internal/catch_section.cpp - Assertion handling
src/catch2/internal/catch_assertion_handler.cpp
Test extensions
- Test generators
src/catch2/generators/catch_generators.hpp - Matchers
src/catch2/matchers/catch_matchers.hpp - Microbenchmarks
src/catch2
Reporting
- Reporter setup
src/catch2/internal/catch_reporter_registry.cpp - Console reporter
src/catch2/reporters/catch_reporter_console.cpp - JSON reporter
src/catch2/reporters/catch_reporter_json.cpp - XML reporter
src/catch2/reporters/catch_reporter_xml.cpp
Other components
- Test author
Connections 15
- Test author → Test and BDD macros: writes tests
README.md - Test author → Microbenchmarks: writes benchmarks
README.md - Test and BDD macros → Test registry: registers tests
- Session runner → Run configuration: uses config
- Session runner → Test selection: selects tests
- Session runner → Test execution: runs tests
- Session runner → Reporter setup: sets up reports
- Test execution → Test registry: loads tests
- Test execution → Section tracking: tracks sections
- Test execution → Assertion handling: handles assertions
- Test execution → Test generators: uses generators
- Test execution → Matchers: evaluates matchers
- Reporter setup → Console reporter: selects reporter
- Reporter setup → JSON reporter: selects reporter
- Reporter setup → XML reporter: selects reporter