AUnit
1.0.0
Unit testing framework for Arduino platforms inspired by ArduinoUnit and Google Test.
|
Class that extends the Assertion class to support the checkTestXxx() and assertTestXxx() macros that look at the status of the named test. More...
#include <MetaAssertion.h>
Protected Member Functions | |
MetaAssertion () | |
Empty constructor. More... | |
bool | assertionTestStatus (const char *file, uint16_t line, const char *testName, const __FlashStringHelper *statusMessage, bool ok) |
Set the status of the current test using the 'ok' status from another test, and print the assertion message if requested. | |
bool | isOutputEnabledForStatus (uint8_t status) |
Return true if setting of status should print a message. More... | |
void | setStatusNow (const char *file, uint16_t line, uint8_t status, const __FlashStringHelper *statusString) |
Set the status of the current test to 'status' and print a message. More... | |
![]() | |
Assertion () | |
Empty constructor. More... | |
bool | isOutputEnabled (bool ok) |
Returns true if an assertion message should be printed. More... | |
bool | assertionBool (const char *file, uint16_t line, bool arg, bool value) |
bool | assertion (const char *file, uint16_t line, bool lhs, const char *opName, bool(*op)(bool lhs, bool rhs), bool rhs) |
bool | assertion (const char *file, uint16_t line, char lhs, const char *opName, bool(*op)(char lhs, char rhs), char rhs) |
bool | assertion (const char *file, uint16_t line, int lhs, const char *opName, bool(*op)(int lhs, int rhs), int rhs) |
bool | assertion (const char *file, uint16_t line, unsigned int lhs, const char *opName, bool(*op)(unsigned int lhs, unsigned int rhs), unsigned int rhs) |
bool | assertion (const char *file, uint16_t line, long lhs, const char *opName, bool(*op)(long lhs, long rhs), long rhs) |
bool | assertion (const char *file, uint16_t line, unsigned long lhs, const char *opName, bool(*op)(unsigned long lhs, unsigned long rhs), unsigned long rhs) |
bool | assertion (const char *file, uint16_t line, double lhs, const char *opName, bool(*op)(double lhs, double rhs), double rhs) |
bool | assertion (const char *file, uint16_t line, const char *lhs, const char *opName, bool(*op)(const char *lhs, const char *rhs), const char *rhs) |
bool | assertion (const char *file, uint16_t line, const char *lhs, const char *opName, bool(*op)(const char *lhs, const String &rhs), const String &rhs) |
bool | assertion (const char *file, uint16_t line, const char *lhs, const char *opName, bool(*op)(const char *lhs, const __FlashStringHelper *rhs), const __FlashStringHelper *rhs) |
bool | assertion (const char *file, uint16_t line, const String &lhs, const char *opName, bool(*op)(const String &lhs, const char *rhs), const char *rhs) |
bool | assertion (const char *file, uint16_t line, const String &lhs, const char *opName, bool(*op)(const String &lhs, const String &rhs), const String &rhs) |
bool | assertion (const char *file, uint16_t line, const String &lhs, const char *opName, bool(*op)(const String &lhs, const __FlashStringHelper *rhs), const __FlashStringHelper *rhs) |
bool | assertion (const char *file, uint16_t line, const __FlashStringHelper *lhs, const char *opName, bool(*op)(const __FlashStringHelper *lhs, const char *rhs), const char *rhs) |
bool | assertion (const char *file, uint16_t line, const __FlashStringHelper *lhs, const char *opName, bool(*op)(const __FlashStringHelper *lhs, const String &rhs), const String &rhs) |
bool | assertion (const char *file, uint16_t line, const __FlashStringHelper *lhs, const char *opName, bool(*op)(const __FlashStringHelper *lhs, const __FlashStringHelper *rhs), const __FlashStringHelper *rhs) |
bool | assertionBoolVerbose (const char *file, uint16_t line, bool arg, const __FlashStringHelper *argString, bool value) |
bool | assertionVerbose (const char *file, uint16_t line, bool lhs, const __FlashStringHelper *lhsString, const char *opName, bool(*op)(bool lhs, bool rhs), bool rhs, const __FlashStringHelper *rhsString) |
bool | assertionVerbose (const char *file, uint16_t line, char lhs, const __FlashStringHelper *lhsString, const char *opName, bool(*op)(char lhs, char rhs), char rhs, const __FlashStringHelper *rhsString) |
bool | assertionVerbose (const char *file, uint16_t line, int lhs, const __FlashStringHelper *lhsString, const char *opName, bool(*op)(int lhs, int rhs), int rhs, const __FlashStringHelper *rhsString) |
bool | assertionVerbose (const char *file, uint16_t line, unsigned int lhs, const __FlashStringHelper *lhsString, const char *opName, bool(*op)(unsigned int lhs, unsigned int rhs), unsigned int rhs, const __FlashStringHelper *rhsString) |
bool | assertionVerbose (const char *file, uint16_t line, long lhs, const __FlashStringHelper *lhsString, const char *opName, bool(*op)(long lhs, long rhs), long rhs, const __FlashStringHelper *rhsString) |
bool | assertionVerbose (const char *file, uint16_t line, unsigned long lhs, const __FlashStringHelper *lhsString, const char *opName, bool(*op)(unsigned long lhs, unsigned long rhs), unsigned long rhs, const __FlashStringHelper *rhsString) |
bool | assertionVerbose (const char *file, uint16_t line, double lhs, const __FlashStringHelper *lhsString, const char *opName, bool(*op)(double lhs, double rhs), double rhs, const __FlashStringHelper *rhsString) |
bool | assertionVerbose (const char *file, uint16_t line, const char *lhs, const __FlashStringHelper *lhsString, const char *opName, bool(*op)(const char *lhs, const char *rhs), const char *rhs, const __FlashStringHelper *rhsString) |
bool | assertionVerbose (const char *file, uint16_t line, const char *lhs, const __FlashStringHelper *lhsString, const char *opName, bool(*op)(const char *lhs, const String &rhs), const String &rhs, const __FlashStringHelper *rhsString) |
bool | assertionVerbose (const char *file, uint16_t line, const char *lhs, const __FlashStringHelper *lhsString, const char *opName, bool(*op)(const char *lhs, const __FlashStringHelper *rhs), const __FlashStringHelper *rhs, const __FlashStringHelper *rhsString) |
bool | assertionVerbose (const char *file, uint16_t line, const String &lhs, const __FlashStringHelper *lhsString, const char *opName, bool(*op)(const String &lhs, const char *rhs), const char *rhs, const __FlashStringHelper *rhsString) |
bool | assertionVerbose (const char *file, uint16_t line, const String &lhs, const __FlashStringHelper *lhsString, const char *opName, bool(*op)(const String &lhs, const String &rhs), const String &rhs, const __FlashStringHelper *rhsString) |
bool | assertionVerbose (const char *file, uint16_t line, const String &lhs, const __FlashStringHelper *lhsString, const char *opName, bool(*op)(const String &lhs, const __FlashStringHelper *rhs), const __FlashStringHelper *rhs, const __FlashStringHelper *rhsString) |
bool | assertionVerbose (const char *file, uint16_t line, const __FlashStringHelper *lhs, const __FlashStringHelper *lhsString, const char *opName, bool(*op)(const __FlashStringHelper *lhs, const char *rhs), const char *rhs, const __FlashStringHelper *rhsString) |
bool | assertionVerbose (const char *file, uint16_t line, const __FlashStringHelper *lhs, const __FlashStringHelper *lhsString, const char *opName, bool(*op)(const __FlashStringHelper *lhs, const String &rhs), const String &rhs, const __FlashStringHelper *rhsString) |
bool | assertionVerbose (const char *file, uint16_t line, const __FlashStringHelper *lhs, const __FlashStringHelper *lhsString, const char *opName, bool(*op)(const __FlashStringHelper *lhs, const __FlashStringHelper *rhs), const __FlashStringHelper *rhs, const __FlashStringHelper *rhsString) |
![]() | |
void | fail () |
Mark the test as failed. More... | |
void | pass () |
Mark the test as passed. More... | |
void | init (const char *name) |
void | init (const __FlashStringHelper *name) |
bool | isVerbosity (uint8_t verbosity) |
Determine if any of the given verbosity is enabled. More... | |
uint8_t | getVerbosity () |
Get the verbosity. More... | |
Additional Inherited Members | |
![]() | |
Test () | |
Empty constructor. More... | |
virtual void | setup () |
Optional method that performs any initialization. More... | |
virtual void | teardown () |
Optional method that performs any clean up after the test ends for any reasons, either passing or otherwise. More... | |
virtual void | loop ()=0 |
The user-provided test case function. More... | |
void | resolve () |
Print out the summary of the current test. More... | |
const internal::FCString & | getName () const |
Get the name of the test. More... | |
uint8_t | getLifeCycle () |
Get the life cycle state of the test. More... | |
void | setLifeCycle (uint8_t state) |
uint8_t | getStatus () |
Get the status of the test. More... | |
void | setStatus (uint8_t status) |
Set the status of the test. More... | |
void | setPassOrFail (bool ok) |
Set the status to Passed or Failed depending on ok. More... | |
Test ** | getNext () |
Return the next pointer as a pointer to the pointer, similar to getRoot(). More... | |
bool | isDone () |
Return true if test has been asserted. More... | |
bool | isNotDone () |
Return true if test is not has been asserted. More... | |
bool | isPassed () |
Return true if test is passed. More... | |
bool | isNotPassed () |
Return true if test is not passed. More... | |
bool | isFailed () |
Return true if test is failed. More... | |
bool | isNotFailed () |
Return true if test is not failed. More... | |
bool | isSkipped () |
Return true if test is skipped. More... | |
bool | isNotSkipped () |
Return true if test is not skipped. More... | |
bool | isExpired () |
Return true if test is expired. More... | |
bool | isNotExpired () |
Return true if test is not expired. More... | |
void | skip () |
Mark the test as skipped. More... | |
void | expire () |
Mark the test as expired (i.e. More... | |
void | enableVerbosity (uint8_t verbosity) |
Enable the given verbosity of the current test. More... | |
void | disableVerbosity (uint8_t verbosity) |
Disable the given verbosity of the current test. More... | |
![]() | |
static Test ** | getRoot () |
Get the pointer to the root pointer. More... | |
![]() | |
static const uint8_t | kLifeCycleNew = 0 |
Test is new, needs to be setup. More... | |
static const uint8_t | kLifeCycleExcluded = 1 |
Test is Excluded by an exclude() method. More... | |
static const uint8_t | kLifeCycleSetup = 2 |
Test has been set up by calling setup() and ready to execute the test code. More... | |
static const uint8_t | kLifeCycleAsserted = 3 |
Test is asserted (using pass(), fail(), expired() or skipped()) and the getStatus() has been determined. More... | |
static const uint8_t | kLifeCycleFinished = 4 |
The test has completed its life cycle. More... | |
static const uint8_t | kStatusUnknown = 0 |
Test status is unknown. More... | |
static const uint8_t | kStatusPassed = 1 |
Test has passed, or pass() was called. More... | |
static const uint8_t | kStatusFailed = 2 |
Test has failed, or fail() was called. More... | |
static const uint8_t | kStatusSkipped = 3 |
Test is skipped through the exclude() method or skip() was called. More... | |
static const uint8_t | kStatusExpired = 4 |
Test has timed out, or expire() called. More... | |
Class that extends the Assertion class to support the checkTestXxx() and assertTestXxx() macros that look at the status of the named test.
Definition at line 42 of file MetaAssertion.h.
|
inlineprotected |
Empty constructor.
Definition at line 59 of file MetaAssertion.h.
|
protected |
Return true if setting of status should print a message.
Definition at line 103 of file MetaAssertion.cpp.
|
protected |
Set the status of the current test to 'status' and print a message.
Definition at line 110 of file MetaAssertion.cpp.