33 #include "Verbosity.h" 37 #define FPSTR(pstr_pointer) \ 38 (reinterpret_cast<const __FlashStringHelper *>(pstr_pointer)) 93 virtual void loop() = 0;
166 void init(
const char* name) {
173 void init(
const __FlashStringHelper* name) {
174 mName = FCString(name);
181 bool isVerbosity(uint8_t verbosity) {
return mVerbosity & verbosity; }
189 Test& operator=(
const Test&) =
delete;
void disableVerbosity(uint8_t verbosity)
Disable the given verbosity of the current test.
Base class of all test cases.
void expire()
Mark the test as expired (i.e.
static const uint8_t kStatusFailed
Test has failed, or failed() was called.
static const uint8_t kStatusNew
Test is new, needs to be setup.
void fail()
Mark the test as failed.
void setPassOrFail(bool ok)
Set the status to Passed or Failed depending on ok.
void resolve()
Print out the summary of the current test.
bool isNotDone()
Return true if test is done (passed, failed, skipped, expired).
static const uint8_t kStatusPassed
Test has passed, or pass() was called.
bool isNotPassed()
Return true if test is passed.
uint8_t getVerbosity()
Get the verbosity.
Test ** getNext()
Return the next pointer as a pointer to the pointer, similar to getRoot().
static const uint8_t kStatusSkipped
Test is skipped, through the exclude() method or skip() was called.
bool isPassed()
Return true if test is passed.
virtual void setup()
Optional method that performs any initialization.
virtual void loop()=0
The user-provided test case function.
void pass()
Mark the test as passed.
void enableVerbosity(uint8_t verbosity)
Enable the given verbosity of the current test.
static Test ** getRoot()
Get the pointer to the root pointer.
bool isExpired()
Return true if test is expired.
A union of (const char*) and (const __FlashStringHelper*) with a discriminator.
bool isVerbosity(uint8_t verbosity)
Determine if any of the given verbosity is enabled.
void skip()
Mark the test as skipped.
bool isDone()
Return true if test is done (passed, failed, skipped, expired).
bool isNotFailed()
Return true if test is failed.
bool isFailed()
Return true if test is failed.
static const uint8_t kStatusSetup
Test is set up.
static const uint8_t kStatusExpired
Test has timed out, or expire() called.
bool isNotSkipped()
Return true if test isNot skipped.
const FCString & getName()
Get the name of the test.
bool isSkipped()
Return true if test isNot skipped.
bool isNotExpired()
Return true if test is expired.
void setStatus(uint8_t status)
Set the status of the test.
uint8_t getStatus()
Get the status of the test.