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