![]() |
micro-test-plus 3.2.2
µ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.
It is advisable to instantiate test suites as static objects. Self-registration occurs within the constructor, and test suites defined in separate compilation units may be executed in any order, as the sequence of static constructor invocation is not specified. Therefore, test suites should not have dependencies on one another.
All registered test suites are executed when the exit_code() function is called, ensuring comprehensive test coverage across the project.
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 that the entire test suite collection is run and reported in a consistent and reliable manner.