33 #include "Verbosity.h"
163 void setLifeCycle(uint8_t state) { mLifeCycle = state; }
258 void init(
const char* name) {
266 void init(
const __FlashStringHelper* name) {
267 mName = internal::FCString(name);
275 bool isVerbosity(uint8_t verbosity)
const {
return mVerbosity & verbosity; }
283 Test& operator=(
const Test&) =
delete;
Base class of all test cases.
bool isNotDone() const
Return true if test is not has been asserted.
bool isDone() const
Return true if test has been asserted.
virtual void loop()=0
The user-provided test case function.
bool isNotPassed() const
Return true if test is not passed.
bool isPassed() const
Return true if test is passed.
static const uint8_t kLifeCycleNew
Test is new, needs to be setup.
static Test ** getRoot()
Get the pointer to the root pointer.
void enableVerbosity(uint8_t verbosity)
Enable the given verbosity of the current test.
bool isNotFailed() const
Return true if test is not failed.
static const uint8_t kLifeCycleSetup
Test has been set up by calling setup() and ready to execute the test code.
uint8_t getLifeCycle() const
Get the life cycle state of the test.
static const uint8_t kStatusFailed
Test has failed, or fail() was called.
bool isVerbosity(uint8_t verbosity) const
Determine if any of the given verbosity is enabled.
bool isNotExpired() const
Return true if test is not expired.
static const uint8_t kLifeCycleFinished
The test has completed its life cycle.
void setStatus(uint8_t status)
Set the status of the test.
static const uint8_t kStatusPassed
Test has passed, or pass() was called.
bool isFailed() const
Return true if test is failed.
void fail()
Mark the test as failed.
bool isSkipped() const
Return true if test is skipped.
virtual void teardown()
Optional method that performs any clean up after the test ends for any reasons, either passing or oth...
static const uint8_t kStatusExpired
Test has timed out, or expire() called.
uint8_t getVerbosity() const
Get the verbosity.
void skip()
Mark the test as skipped.
static const uint8_t kLifeCycleAsserted
Test is asserted (using pass(), fail(), expired() or skipped()) and the getStatus() has been determin...
bool isNotSkipped() const
Return true if test is not skipped.
static const uint8_t kStatusUnknown
Test status is unknown.
static const uint8_t kStatusSkipped
Test is skipped through the exclude() method or skip() was called.
uint8_t getStatus() const
Get the status of the test.
void expire()
Mark the test as expired (i.e.
static const uint8_t kLifeCycleExcluded
Test is Excluded by an exclude() method.
void resolve()
Print out the summary of the current test.
Test ** getNext()
Return the next pointer as a pointer to the pointer, similar to getRoot().
void disableVerbosity(uint8_t verbosity)
Disable the given verbosity of the current test.
virtual void setup()
Optional method that performs any initialization.
void pass()
Mark the test as passed.
void setPassOrFail(bool ok)
Set the status to Passed or Failed depending on ok.
bool isExpired() const
Return true if test is expired.
const internal::FCString & getName() const
Get the name of the test.
A union of (const char*) and (const __FlashStringHelper*) with a discriminator.