33 #include "Verbosity.h" 152 virtual void loop() = 0;
163 void setLifeCycle(uint8_t state) { mLifeCycle = state; }
174 if (status != kStatusUnknown) {
175 setLifeCycle(kLifeCycleAsserted);
258 void init(
const char* name) {
266 void init(
const __FlashStringHelper* name) {
275 bool isVerbosity(uint8_t verbosity) {
return mVerbosity & verbosity; }
283 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 kStatusUnknown
Test status is unknown.
static const uint8_t kStatusFailed
Test has failed, or fail() was called.
void fail()
Mark the test as failed.
static const uint8_t kLifeCycleAsserted
Test is asserted (using pass(), fail(), expired() or skipped()) and the getStatus() has been determin...
const internal::FCString & getName()
Get the name of the test.
void setPassOrFail(bool ok)
Set the status to Passed or Failed depending on ok.
void resolve()
Print out the summary of the current test.
A union of (const char*) and (const __FlashStringHelper*) with a discriminator.
bool isNotDone()
Return true if test is not has been asserted.
static const uint8_t kStatusPassed
Test has passed, or pass() was called.
bool isNotPassed()
Return true if test is not passed.
uint8_t getVerbosity()
Get the verbosity.
uint8_t getLifeCycle()
Get the life cycle state of the test.
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.
static const uint8_t kLifeCycleExcluded
Test is Excluded by an exclude() method.
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.
static const uint8_t kLifeCycleFinished
The test has completed its life cycle.
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 has been asserted.
bool isNotFailed()
Return true if test is not failed.
static const uint8_t kLifeCycleNew
Test is new, needs to be setup.
bool isFailed()
Return true if test is failed.
static const uint8_t kLifeCycleSetup
Test has been set up by calling setup() and ready to execute the test code.
static const uint8_t kStatusExpired
Test has timed out, or expire() called.
bool isNotSkipped()
Return true if test is not skipped.
virtual void teardown()
Optional method that performs any clean up after the test ends for any reasons, either passing or oth...
bool isSkipped()
Return true if test is skipped.
bool isNotExpired()
Return true if test is not expired.
void setStatus(uint8_t status)
Set the status of the test.
uint8_t getStatus()
Get the status of the test.