Base class of all test cases.
More...
#include <Test.h>
|
void | fail () |
| Mark the test as failed. More...
|
|
void | pass () |
| Mark the test as passed. More...
|
|
void | init (const char *name) |
|
void | init (const __FlashStringHelper *name) |
|
bool | isVerbosity (uint8_t verbosity) |
| Determine if any of the given verbosity is enabled. More...
|
|
uint8_t | getVerbosity () |
| Get the verbosity. More...
|
|
Base class of all test cases.
The test() and testing() macros define subclasses of Test or TestOnce (respectively), and allow the code following the macros in '{}' to become the body of the loop() and once() methods of the two classes (respectively).
Definition at line 49 of file Test.h.
◆ Test()
Empty constructor.
The name will be set later.
Definition at line 49 of file Test.cpp.
◆ disableVerbosity()
void aunit::Test::disableVerbosity |
( |
uint8_t |
verbosity | ) |
|
|
inline |
Disable the given verbosity of the current test.
Definition at line 169 of file Test.h.
◆ enableVerbosity()
void aunit::Test::enableVerbosity |
( |
uint8_t |
verbosity | ) |
|
|
inline |
Enable the given verbosity of the current test.
Definition at line 166 of file Test.h.
◆ expire()
void aunit::Test::expire |
( |
| ) |
|
|
inline |
Mark the test as expired (i.e.
timed out).
Definition at line 163 of file Test.h.
◆ fail()
void aunit::Test::fail |
( |
| ) |
|
|
inlineprotected |
Mark the test as failed.
Definition at line 173 of file Test.h.
◆ getName()
const FCString& aunit::Test::getName |
( |
| ) |
|
|
inline |
Get the name of the test.
Definition at line 111 of file Test.h.
◆ getNext()
Test** aunit::Test::getNext |
( |
| ) |
|
|
inline |
Return the next pointer as a pointer to the pointer, similar to getRoot().
This makes it much easier to manipulate a singly-linked list. Also makes setNext() method unnecessary.
Definition at line 127 of file Test.h.
◆ getRoot()
Test ** aunit::Test::getRoot |
( |
| ) |
|
|
static |
Get the pointer to the root pointer.
Implemented as a function static so fixes the C++ static initialization problem making it safe to use this in other static contexts.
Definition at line 44 of file Test.cpp.
◆ getStatus()
uint8_t aunit::Test::getStatus |
( |
| ) |
|
|
inline |
Get the status of the test.
Definition at line 114 of file Test.h.
◆ getVerbosity()
uint8_t aunit::Test::getVerbosity |
( |
| ) |
|
|
inlineprotected |
Get the verbosity.
Definition at line 196 of file Test.h.
◆ isDone()
bool aunit::Test::isDone |
( |
| ) |
|
|
inline |
Return true if test is done (passed, failed, skipped, expired).
Definition at line 130 of file Test.h.
◆ isExpired()
bool aunit::Test::isExpired |
( |
| ) |
|
|
inline |
Return true if test is expired.
Definition at line 154 of file Test.h.
◆ isFailed()
bool aunit::Test::isFailed |
( |
| ) |
|
|
inline |
Return true if test is failed.
Definition at line 142 of file Test.h.
◆ isNotDone()
bool aunit::Test::isNotDone |
( |
| ) |
|
|
inline |
Return true if test is done (passed, failed, skipped, expired).
Definition at line 133 of file Test.h.
◆ isNotExpired()
bool aunit::Test::isNotExpired |
( |
| ) |
|
|
inline |
Return true if test is expired.
Definition at line 157 of file Test.h.
◆ isNotFailed()
bool aunit::Test::isNotFailed |
( |
| ) |
|
|
inline |
Return true if test is failed.
Definition at line 145 of file Test.h.
◆ isNotPassed()
bool aunit::Test::isNotPassed |
( |
| ) |
|
|
inline |
Return true if test is passed.
Definition at line 139 of file Test.h.
◆ isNotSkipped()
bool aunit::Test::isNotSkipped |
( |
| ) |
|
|
inline |
Return true if test isNot skipped.
Definition at line 151 of file Test.h.
◆ isPassed()
bool aunit::Test::isPassed |
( |
| ) |
|
|
inline |
Return true if test is passed.
Definition at line 136 of file Test.h.
◆ isSkipped()
bool aunit::Test::isSkipped |
( |
| ) |
|
|
inline |
Return true if test isNot skipped.
Definition at line 148 of file Test.h.
◆ isVerbosity()
bool aunit::Test::isVerbosity |
( |
uint8_t |
verbosity | ) |
|
|
inlineprotected |
Determine if any of the given verbosity is enabled.
Definition at line 193 of file Test.h.
◆ loop()
virtual void aunit::Test::loop |
( |
| ) |
|
|
pure virtual |
◆ pass()
void aunit::Test::pass |
( |
| ) |
|
|
inlineprotected |
Mark the test as passed.
Definition at line 176 of file Test.h.
◆ resolve()
void aunit::Test::resolve |
( |
| ) |
|
Print out the summary of the current test.
Definition at line 80 of file Test.cpp.
◆ setPassOrFail()
void aunit::Test::setPassOrFail |
( |
bool |
ok | ) |
|
Set the status to Passed or Failed depending on ok.
Definition at line 57 of file Test.cpp.
◆ setStatus()
void aunit::Test::setStatus |
( |
uint8_t |
status | ) |
|
|
inline |
Set the status of the test.
Definition at line 117 of file Test.h.
◆ setup()
virtual void aunit::Test::setup |
( |
| ) |
|
|
inlinevirtual |
Optional method that performs any initialization.
The assertXxx() macros, as well as pass(), fail() and skip() functions can be called in here. Subclasses that override this should call the parent's setup() method in the first line so that the setup() methods in the inheritance tree are properly chained.
Definition at line 89 of file Test.h.
◆ skip()
void aunit::Test::skip |
( |
| ) |
|
|
inline |
Mark the test as skipped.
Definition at line 160 of file Test.h.
◆ teardown()
virtual void aunit::Test::teardown |
( |
| ) |
|
|
inlinevirtual |
Optional method that performs any clean up after the test ends for any reasons, either passing or otherwise.
Subclasses that override this should call the parent's teardown() method in the last line before returning, so that the teardown() methods in the inheritance tree are properly chained.
Definition at line 98 of file Test.h.
◆ kStatusExpired
const uint8_t aunit::Test::kStatusExpired = 5 |
|
static |
◆ kStatusFailed
const uint8_t aunit::Test::kStatusFailed = 3 |
|
static |
Test has failed, or failed() was called.
Definition at line 64 of file Test.h.
◆ kStatusNew
const uint8_t aunit::Test::kStatusNew = 0 |
|
static |
Test is new, needs to be setup.
Definition at line 55 of file Test.h.
◆ kStatusPassed
const uint8_t aunit::Test::kStatusPassed = 2 |
|
static |
◆ kStatusSetup
const uint8_t aunit::Test::kStatusSetup = 1 |
|
static |
◆ kStatusSkipped
const uint8_t aunit::Test::kStatusSkipped = 4 |
|
static |
Test is skipped, through the exclude() method or skip() was called.
Definition at line 67 of file Test.h.
The documentation for this class was generated from the following files:
- /Users/brian/dev/AUnit/src/aunit/Test.h
- /Users/brian/dev/AUnit/src/aunit/Test.cpp