|
micro-test-plus 3.3.1
µTest++ Testing Framework
|
Test suites are named collections of test cases. More...
Classes | |
| class | micro_os_plus::micro_test_plus::test_suite |
| Represents a named group of test cases that self-register to the runner. More... | |
Test suites in µTest++ are named groups of related test cases, allowing for structured organisation and execution of tests. By default, all test cases defined in main() are included in the default (main) test suite and are executed immediately.
For more complex projects, multiple test suites can be defined, typically in separate source files. Test suites are implemented as classes, constructed with a name, a callable (usually a lambda that chains the execution of the test cases), and optional arguments. This design enables self-registration of test suites, ensuring they are automatically included in the test run.
Self-registration is performed within the constructor, ensuring that each test suite is automatically included in the test run. When test suites are defined in separate compilation units, they may be executed in any order, as the sequence in which static constructors are invoked is not specified. Consequently, test suites should be designed to be independent and must not rely on the execution order of other suites.
All registered test suites are executed when the exit_code() function is called, guaranteeing comprehensive test coverage across the project.