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)
const {
return mVerbosity & verbosity; }
283 Test& operator=(
const Test&) =
delete;
bool isNotPassed() const
Return true if test is not passed.
bool isFailed() const
Return true if test is failed.
void disableVerbosity(uint8_t verbosity)
Disable the given verbosity of the current test.
Base class of all test cases.
const internal::FCString & getName() const
Get the name of the test.
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.
bool isVerbosity(uint8_t verbosity) const
Determine if any of the given verbosity is enabled.
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...
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.
static const uint8_t kStatusPassed
Test has passed, or pass() was called.
bool isNotExpired() const
Return true if test is not expired.
uint8_t getVerbosity() const
Get the verbosity.
bool isNotDone() const
Return true if test is not has been asserted.
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.
virtual void setup()
Optional method that performs any initialization.
static const uint8_t kLifeCycleExcluded
Test is Excluded by an exclude() method.
bool isNotSkipped() const
Return true if test is not skipped.
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.
static const uint8_t kLifeCycleFinished
The test has completed its life cycle.
void skip()
Mark the test as skipped.
bool isExpired() const
Return true if test is expired.
static const uint8_t kLifeCycleNew
Test is new, needs to be setup.
static const uint8_t kLifeCycleSetup
Test has been set up by calling setup() and ready to execute the test code.
bool isDone() const
Return true if test has been asserted.
uint8_t getLifeCycle() const
Get the life cycle state of the test.
static const uint8_t kStatusExpired
Test has timed out, or expire() called.
bool isPassed() const
Return true if test is passed.
bool isNotFailed() const
Return true if test is not 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...
void setStatus(uint8_t status)
Set the status of the test.
uint8_t getStatus() const
Get the status of the test.