AUnit
0.3.1
Unit testing framework for Arduino platforms inspired by ArduinoUnit.
|
The class that runs the various test cases defined by the test() and testing() macros. More...
#include <TestRunner.h>
Static Public Member Functions | |
static void | run () |
Run all tests using the current runner. More... | |
static void | list () |
Print out the known tests. More... | |
static void | exclude (const char *pattern) |
Exclude the tests which match the pattern. More... | |
static void | include (const char *pattern) |
Include the tests which match the pattern. More... | |
static void | setVerbosity (uint8_t verbosity) |
Set the verbosity flag. More... | |
static bool | isVerbosity (uint8_t verbosity) |
Returns true if ANY of the bit flags of 'verbosity' is set. More... | |
static void | setPrinter (Print *printer) |
Set the output printer. More... | |
static void | setPassOrFail (bool ok) |
Set the pass/fail status of the current test. More... | |
static void | setTimeout (long millis) |
Set test runner timeout across all tests, in millis. More... | |
The class that runs the various test cases defined by the test() and testing() macros.
It prints the summary of each test as well as the final summary of the entire run at the end. In the future, it may be possible to allow a different TestRunner to be used.
Definition at line 41 of file TestRunner.h.
|
inlinestatic |
Exclude the tests which match the pattern.
Currently supports only a trailing '*'. For example, exclude("flash*").
Definition at line 53 of file TestRunner.h.
|
inlinestatic |
Include the tests which match the pattern.
Currently supports only a trailing '*'. For example, include("flash*").
Definition at line 61 of file TestRunner.h.
|
inlinestatic |
Returns true if ANY of the bit flags of 'verbosity' is set.
Definition at line 71 of file TestRunner.h.
|
inlinestatic |
|
inlinestatic |
Run all tests using the current runner.
Definition at line 44 of file TestRunner.h.
|
inlinestatic |
Set the pass/fail status of the current test.
Definition at line 79 of file TestRunner.h.
|
static |
Set the output printer.
Definition at line 46 of file TestRunner.cpp.
|
inlinestatic |
Set test runner timeout across all tests, in millis.
Set to 0 for infinite timeout. Useful for preventing testing() test cases that never end. This a timeout for the TestRunner itself, not for individual tests.
It might be usefult to allow timeouts on a per-test basis, but I'm reluctant to do that at the Test class level because it would add extra 4 bytes (maybe 2 if we allowed a small maximum) of static memory per test case. The solution might be to allow the end-user to choose to pay for this extra cost if they want to. I think the right way to do that is to add support for test fixtures which is something on the back of my mind.
Definition at line 94 of file TestRunner.h.
|
inlinestatic |
Set the verbosity flag.
Definition at line 66 of file TestRunner.h.