micro-test-plus 3.2.0
µTest++, a lightweight testing framework for embedded platforms
|
Functions to initialise the framework and exit. More...
Functions | |
int | micro_os_plus::micro_test_plus::exit_code (void) |
Complete the test and return the exit code. | |
void | micro_os_plus::micro_test_plus::initialize (int argc, char *argv[], const char *name="Main") |
Initialize the test framework. | |
Functions to initialise the framework and exit.
These are functions to initialise the test runner and to return the test result as the process exit code.
The absolute minimal test has a single test case, with a single expectation; for example:
When running this test, the output looks like:
int micro_os_plus::micro_test_plus::exit_code | ( | void | ) |
Complete the test and return the exit code.
In addition to the test cases defined in main()
, there can be more separate test suites, defined as static objects in the same file or in other files, and self-registered via the static constructors mechanism.
This function triggers the execution of the globally registered test suites (if any) and returns the test result as the process exit code (0 = success).
Definition at line 78 of file micro-test-plus.cpp.
void micro_os_plus::micro_test_plus::initialize | ( | int | argc, |
char * | argv[], | ||
const char * | name = "Main" ) |
Initialize the test framework.
[in] | argc | The number of arguments. |
[in] | argv | Array of pointers to null terminated arguments. |
[in] | name | The name of the default test suite. |
All tests include a default test suite, which runs the test cases defined in the main function.
This function forwards the process arguments to the test framework and initialises the runner.
The name is used to identify the default test suite.
The arguments can be used to control the verbosity level.
Definition at line 57 of file micro-test-plus.cpp.