AUnit  0.5.2
Unit testing framework for Arduino platforms inspired by ArduinoUnit and Google Test.
Macros
MetaAssertMacros.h File Reference

Various assertTestXxx(), checkTestXxx(), assertTestXxxF() and checkTestXxxF() macros are defined in this header. More...

#include "Flash.h"
Include dependency graph for MetaAssertMacros.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define checkTestDone(name)   (test_##name##_instance.isDone())
 Return true if test 'name' is done. More...
 
#define checkTestNotDone(name)   (test_##name##_instance.isNotDone())
 Return true if test 'name' is not done. More...
 
#define checkTestPass(name)   (test_##name##_instance.isPassed())
 Return true if test 'name' has passed. More...
 
#define checkTestNotPass(name)   (test_##name##_instance.isNotPassed())
 Return true if test 'name' has not passed. More...
 
#define checkTestFail(name)   (test_##name##_instance.isFailed())
 Return true if test 'name' has failed. More...
 
#define checkTestNotFail(name)   (test_##name##_instance.isNotFailed())
 Return true if test 'name' has not failed. More...
 
#define checkTestSkip(name)   (test_##name##_instance.isSkipped())
 Return true if test 'name' has been skipped. More...
 
#define checkTestNotSkip(name)   (test_##name##_instance.isNotSkipped())
 Return true if test 'name' has not been skipped. More...
 
#define checkTestExpire(name)   (test_##name##_instance.isExpired())
 Return true if test 'name' has timed out. More...
 
#define checkTestNotExpire(name)   (test_##name##_instance.isNotExpired())
 Return true if test 'name' has not timed out. More...
 
#define assertTestDone(name)   assertTestStatusInternal(name, isDone, kMessageDone)
 Assert that test 'name' is done. More...
 
#define assertTestNotDone(name)   assertTestStatusInternal(name, isNotDone, kMessageNotDone)
 Assert that test 'name' is not done. More...
 
#define assertTestPass(name)   assertTestStatusInternal(name, isPassed, kMessagePassed)
 Assert that test 'name' has passed. More...
 
#define assertTestNotPass(name)   assertTestStatusInternal(name, isNotPassed, kMessageNotPassed)
 Assert that test 'name' has not passed. More...
 
#define assertTestFail(name)   assertTestStatusInternal(name, isFailed, kMessageFailed)
 Assert that test 'name' has failed. More...
 
#define assertTestNotFail(name)   assertTestStatusInternal(name, isNotFailed, kMessageNotFailed)
 Assert that test 'name' has not failed. More...
 
#define assertTestSkip(name)   assertTestStatusInternal(name, isSkipped, kMessageSkipped)
 Assert that test 'name' has been skipped. More...
 
#define assertTestNotSkip(name)   assertTestStatusInternal(name, isNotSkipped, kMessageNotSkipped)
 Assert that test 'name' has not been skipped. More...
 
#define assertTestExpire(name)   assertTestStatusInternal(name, isExpired, kMessageExpired)
 Assert that test 'name' has timed out. More...
 
#define assertTestNotExpire(name)   assertTestStatusInternal(name, isNotExpired, kMessageNotExpired)
 Assert that test 'name' has not timed out. More...
 
#define assertTestStatusInternal(name, method, message)
 Internal helper macro, shouldn't be called directly by users. More...
 
#define checkTestDoneF(testClass, name)   (testClass##_##name##_instance.isDone())
 Return true if test 'name' is done. More...
 
#define checkTestNotDoneF(testClass, name)   (testClass##_##name##_instance.isNotDone())
 Return true if test 'name' is not done. More...
 
#define checkTestPassF(testClass, name)   (testClass##_##name##_instance.isPassed())
 Return true if test 'name' has passed. More...
 
#define checkTestNotPassF(testClass, name)   (testClass##_##name##_instance.isNotPassed())
 Return true if test 'name' has not passed. More...
 
#define checkTestFailF(testClass, name)   (testClass##_##name##_instance.isFailed())
 Return true if test 'name' has failed. More...
 
#define checkTestNotFailF(testClass, name)   (testClass##_##name##_instance.isNotFailed())
 Return true if test 'name' has not failed. More...
 
#define checkTestSkipF(testClass, name)   (testClass##_##name##_instance.isSkipped())
 Return true if test 'name' has been skipped. More...
 
#define checkTestNotSkipF(testClass, name)   (testClass##_##name##_instance.isNotSkipped())
 Return true if test 'name' has not been skipped. More...
 
#define checkTestExpireF(testClass, name)   (testClass##_##name##_instance.isExpired())
 Return true if test 'name' has timed out. More...
 
#define checkTestNotExpireF(testClass, name)   (testClass##_##name##_instance.isNotExpired())
 Return true if test 'name' has not timed out. More...
 
#define assertTestDoneF(testClass, name)   assertTestStatusInternalF(testClass, name, isDone, kMessageDone)
 Assert that test 'name' is done. More...
 
#define assertTestNotDoneF(testClass, name)   assertTestStatusInternalF(testClass, name, isNotDone, kMessageNotDone)
 Assert that test 'name' is not done. More...
 
#define assertTestPassF(testClass, name)   assertTestStatusInternalF(testClass, name, isPassed, kMessagePassed)
 Assert that test 'name' has passed. More...
 
#define assertTestNotPassF(testClass, name)   assertTestStatusInternalF(testClass, name, isNotPassed, kMessageNotPassed)
 Assert that test 'name' has not passed. More...
 
#define assertTestFailF(testClass, name)   assertTestStatusInternalF(testClass, name, isFailed, kMessageFailed)
 Assert that test 'name' has failed. More...
 
#define assertTestNotFailF(testClass, name)   assertTestStatusInternalF(testClass, name, isNotFailed, kMessageNotFailed)
 Assert that test 'name' has not failed. More...
 
#define assertTestSkipF(testClass, name)   assertTestStatusInternalF(testClass, name, isSkipped, kMessageSkipped)
 Assert that test 'name' has been skipped. More...
 
#define assertTestNotSkipF(testClass, name)
 Assert that test 'name' has not been skipped. More...
 
#define assertTestExpireF(testClass, name)   assertTestStatusInternalF(testClass, name, isExpired, kMessageExpired)
 Assert that test 'name' has timed out. More...
 
#define assertTestNotExpireF(testClass, name)
 Assert that test 'name' has not timed out. More...
 
#define assertTestStatusInternalF(testClass, name, method, message)
 Internal helper macro, shouldn't be called directly by users. More...
 
#define failTestNow()
 Fail the current test, return immediately, and print a status message. More...
 
#define passTestNow()
 Pass the current test, print a status message, and return immediately. More...
 
#define skipTestNow()
 Skip the current test, print a status message, and return immediately. More...
 
#define expireTestNow()
 Expire the current test, print a status message, and return immediately. More...
 

Detailed Description

Various assertTestXxx(), checkTestXxx(), assertTestXxxF() and checkTestXxxF() macros are defined in this header.

Definition in file MetaAssertMacros.h.

Macro Definition Documentation

◆ assertTestDone

#define assertTestDone (   name)    assertTestStatusInternal(name, isDone, kMessageDone)

Assert that test 'name' is done.

Definition at line 77 of file MetaAssertMacros.h.

◆ assertTestDoneF

#define assertTestDoneF (   testClass,
  name 
)    assertTestStatusInternalF(testClass, name, isDone, kMessageDone)

Assert that test 'name' is done.

Definition at line 170 of file MetaAssertMacros.h.

◆ assertTestExpire

#define assertTestExpire (   name)    assertTestStatusInternal(name, isExpired, kMessageExpired)

Assert that test 'name' has timed out.

Definition at line 109 of file MetaAssertMacros.h.

◆ assertTestExpireF

#define assertTestExpireF (   testClass,
  name 
)    assertTestStatusInternalF(testClass, name, isExpired, kMessageExpired)

Assert that test 'name' has timed out.

Definition at line 203 of file MetaAssertMacros.h.

◆ assertTestFail

#define assertTestFail (   name)    assertTestStatusInternal(name, isFailed, kMessageFailed)

Assert that test 'name' has failed.

Definition at line 93 of file MetaAssertMacros.h.

◆ assertTestFailF

#define assertTestFailF (   testClass,
  name 
)    assertTestStatusInternalF(testClass, name, isFailed, kMessageFailed)

Assert that test 'name' has failed.

Definition at line 186 of file MetaAssertMacros.h.

◆ assertTestNotDone

#define assertTestNotDone (   name)    assertTestStatusInternal(name, isNotDone, kMessageNotDone)

Assert that test 'name' is not done.

Definition at line 81 of file MetaAssertMacros.h.

◆ assertTestNotDoneF

#define assertTestNotDoneF (   testClass,
  name 
)    assertTestStatusInternalF(testClass, name, isNotDone, kMessageNotDone)

Assert that test 'name' is not done.

Definition at line 174 of file MetaAssertMacros.h.

◆ assertTestNotExpire

#define assertTestNotExpire (   name)    assertTestStatusInternal(name, isNotExpired, kMessageNotExpired)

Assert that test 'name' has not timed out.

Definition at line 113 of file MetaAssertMacros.h.

◆ assertTestNotExpireF

#define assertTestNotExpireF (   testClass,
  name 
)
Value:
assertTestStatusInternalF(testClass, name, isNotExpired, \
kMessageNotExpired)
#define assertTestStatusInternalF(testClass, name, method, message)
Internal helper macro, shouldn't be called directly by users.

Assert that test 'name' has not timed out.

Definition at line 207 of file MetaAssertMacros.h.

◆ assertTestNotFail

#define assertTestNotFail (   name)    assertTestStatusInternal(name, isNotFailed, kMessageNotFailed)

Assert that test 'name' has not failed.

Definition at line 97 of file MetaAssertMacros.h.

◆ assertTestNotFailF

#define assertTestNotFailF (   testClass,
  name 
)    assertTestStatusInternalF(testClass, name, isNotFailed, kMessageNotFailed)

Assert that test 'name' has not failed.

Definition at line 190 of file MetaAssertMacros.h.

◆ assertTestNotPass

#define assertTestNotPass (   name)    assertTestStatusInternal(name, isNotPassed, kMessageNotPassed)

Assert that test 'name' has not passed.

Definition at line 89 of file MetaAssertMacros.h.

◆ assertTestNotPassF

#define assertTestNotPassF (   testClass,
  name 
)    assertTestStatusInternalF(testClass, name, isNotPassed, kMessageNotPassed)

Assert that test 'name' has not passed.

Definition at line 182 of file MetaAssertMacros.h.

◆ assertTestNotSkip

#define assertTestNotSkip (   name)    assertTestStatusInternal(name, isNotSkipped, kMessageNotSkipped)

Assert that test 'name' has not been skipped.

Definition at line 105 of file MetaAssertMacros.h.

◆ assertTestNotSkipF

#define assertTestNotSkipF (   testClass,
  name 
)
Value:
assertTestStatusInternalF(testClass, name, isNotSkipped, \
kMessageNotSkipped)
#define assertTestStatusInternalF(testClass, name, method, message)
Internal helper macro, shouldn't be called directly by users.

Assert that test 'name' has not been skipped.

Definition at line 198 of file MetaAssertMacros.h.

◆ assertTestPass

#define assertTestPass (   name)    assertTestStatusInternal(name, isPassed, kMessagePassed)

Assert that test 'name' has passed.

Definition at line 85 of file MetaAssertMacros.h.

◆ assertTestPassF

#define assertTestPassF (   testClass,
  name 
)    assertTestStatusInternalF(testClass, name, isPassed, kMessagePassed)

Assert that test 'name' has passed.

Definition at line 178 of file MetaAssertMacros.h.

◆ assertTestSkip

#define assertTestSkip (   name)    assertTestStatusInternal(name, isSkipped, kMessageSkipped)

Assert that test 'name' has been skipped.

Definition at line 101 of file MetaAssertMacros.h.

◆ assertTestSkipF

#define assertTestSkipF (   testClass,
  name 
)    assertTestStatusInternalF(testClass, name, isSkipped, kMessageSkipped)

Assert that test 'name' has been skipped.

Definition at line 194 of file MetaAssertMacros.h.

◆ assertTestStatusInternal

#define assertTestStatusInternal (   name,
  method,
  message 
)
Value:
do {\
if (!assertionTestStatus(\
__FILE__,__LINE__,#name,AUNIT_FPSTR(message),test_##name##_instance.method()))\
return;\
} while (false)
#define AUNIT_FPSTR(pstr_pointer)
The FPSTR() macro is defined on ESP8266, not defined on Teensy and AVR, and broken on ESP32...
Definition: Flash.h:75

Internal helper macro, shouldn't be called directly by users.

Definition at line 117 of file MetaAssertMacros.h.

◆ assertTestStatusInternalF

#define assertTestStatusInternalF (   testClass,
  name,
  method,
  message 
)
Value:
do {\
if (!assertionTestStatus(__FILE__, __LINE__, #name, AUNIT_FPSTR(message),\
testClass##_##name##_instance.method()))\
return;\
} while (false)
#define AUNIT_FPSTR(pstr_pointer)
The FPSTR() macro is defined on ESP8266, not defined on Teensy and AVR, and broken on ESP32...
Definition: Flash.h:75

Internal helper macro, shouldn't be called directly by users.

Definition at line 212 of file MetaAssertMacros.h.

◆ checkTestDone

#define checkTestDone (   name)    (test_##name##_instance.isDone())

Return true if test 'name' is done.

Definition at line 44 of file MetaAssertMacros.h.

◆ checkTestDoneF

#define checkTestDoneF (   testClass,
  name 
)    (testClass##_##name##_instance.isDone())

Return true if test 'name' is done.

Definition at line 127 of file MetaAssertMacros.h.

◆ checkTestExpire

#define checkTestExpire (   name)    (test_##name##_instance.isExpired())

Return true if test 'name' has timed out.

Definition at line 68 of file MetaAssertMacros.h.

◆ checkTestExpireF

#define checkTestExpireF (   testClass,
  name 
)    (testClass##_##name##_instance.isExpired())

Return true if test 'name' has timed out.

Definition at line 159 of file MetaAssertMacros.h.

◆ checkTestFail

#define checkTestFail (   name)    (test_##name##_instance.isFailed())

Return true if test 'name' has failed.

Definition at line 56 of file MetaAssertMacros.h.

◆ checkTestFailF

#define checkTestFailF (   testClass,
  name 
)    (testClass##_##name##_instance.isFailed())

Return true if test 'name' has failed.

Definition at line 143 of file MetaAssertMacros.h.

◆ checkTestNotDone

#define checkTestNotDone (   name)    (test_##name##_instance.isNotDone())

Return true if test 'name' is not done.

Definition at line 47 of file MetaAssertMacros.h.

◆ checkTestNotDoneF

#define checkTestNotDoneF (   testClass,
  name 
)    (testClass##_##name##_instance.isNotDone())

Return true if test 'name' is not done.

Definition at line 131 of file MetaAssertMacros.h.

◆ checkTestNotExpire

#define checkTestNotExpire (   name)    (test_##name##_instance.isNotExpired())

Return true if test 'name' has not timed out.

Definition at line 71 of file MetaAssertMacros.h.

◆ checkTestNotExpireF

#define checkTestNotExpireF (   testClass,
  name 
)    (testClass##_##name##_instance.isNotExpired())

Return true if test 'name' has not timed out.

Definition at line 163 of file MetaAssertMacros.h.

◆ checkTestNotFail

#define checkTestNotFail (   name)    (test_##name##_instance.isNotFailed())

Return true if test 'name' has not failed.

Definition at line 59 of file MetaAssertMacros.h.

◆ checkTestNotFailF

#define checkTestNotFailF (   testClass,
  name 
)    (testClass##_##name##_instance.isNotFailed())

Return true if test 'name' has not failed.

Definition at line 147 of file MetaAssertMacros.h.

◆ checkTestNotPass

#define checkTestNotPass (   name)    (test_##name##_instance.isNotPassed())

Return true if test 'name' has not passed.

Definition at line 53 of file MetaAssertMacros.h.

◆ checkTestNotPassF

#define checkTestNotPassF (   testClass,
  name 
)    (testClass##_##name##_instance.isNotPassed())

Return true if test 'name' has not passed.

Definition at line 139 of file MetaAssertMacros.h.

◆ checkTestNotSkip

#define checkTestNotSkip (   name)    (test_##name##_instance.isNotSkipped())

Return true if test 'name' has not been skipped.

Definition at line 65 of file MetaAssertMacros.h.

◆ checkTestNotSkipF

#define checkTestNotSkipF (   testClass,
  name 
)    (testClass##_##name##_instance.isNotSkipped())

Return true if test 'name' has not been skipped.

Definition at line 155 of file MetaAssertMacros.h.

◆ checkTestPass

#define checkTestPass (   name)    (test_##name##_instance.isPassed())

Return true if test 'name' has passed.

Definition at line 50 of file MetaAssertMacros.h.

◆ checkTestPassF

#define checkTestPassF (   testClass,
  name 
)    (testClass##_##name##_instance.isPassed())

Return true if test 'name' has passed.

Definition at line 135 of file MetaAssertMacros.h.

◆ checkTestSkip

#define checkTestSkip (   name)    (test_##name##_instance.isSkipped())

Return true if test 'name' has been skipped.

Definition at line 62 of file MetaAssertMacros.h.

◆ checkTestSkipF

#define checkTestSkipF (   testClass,
  name 
)    (testClass##_##name##_instance.isSkipped())

Return true if test 'name' has been skipped.

Definition at line 151 of file MetaAssertMacros.h.

◆ expireTestNow

#define expireTestNow ( )
Value:
do {\
setStatusNow(__FILE__, __LINE__, kStatusExpired,\
AUNIT_FPSTR(kMessageExpired));\
return;\
} while (false)
#define AUNIT_FPSTR(pstr_pointer)
The FPSTR() macro is defined on ESP8266, not defined on Teensy and AVR, and broken on ESP32...
Definition: Flash.h:75

Expire the current test, print a status message, and return immediately.

Similar to Test::expire() except that this prints a status message.

Definition at line 253 of file MetaAssertMacros.h.

◆ failTestNow

#define failTestNow ( )
Value:
do {\
setStatusNow(__FILE__, __LINE__, kStatusFailed, AUNIT_FPSTR(kMessageFailed));\
return;\
} while (false)
#define AUNIT_FPSTR(pstr_pointer)
The FPSTR() macro is defined on ESP8266, not defined on Teensy and AVR, and broken on ESP32...
Definition: Flash.h:75

Fail the current test, return immediately, and print a status message.

Similar to Test::fail() except that this prints a status message.

Definition at line 225 of file MetaAssertMacros.h.

◆ passTestNow

#define passTestNow ( )
Value:
do {\
setStatusNow(__FILE__, __LINE__, kStatusPassed, AUNIT_FPSTR(kMessagePassed));\
return;\
} while (false)
#define AUNIT_FPSTR(pstr_pointer)
The FPSTR() macro is defined on ESP8266, not defined on Teensy and AVR, and broken on ESP32...
Definition: Flash.h:75

Pass the current test, print a status message, and return immediately.

Similar to Test::pass() except that this prints a status message.

Definition at line 234 of file MetaAssertMacros.h.

◆ skipTestNow

#define skipTestNow ( )
Value:
do {\
setStatusNow(__FILE__, __LINE__, kStatusSkipped,\
AUNIT_FPSTR(kMessageSkipped));\
return;\
} while (false)
#define AUNIT_FPSTR(pstr_pointer)
The FPSTR() macro is defined on ESP8266, not defined on Teensy and AVR, and broken on ESP32...
Definition: Flash.h:75

Skip the current test, print a status message, and return immediately.

Similar to Test::skip() except that this prints a status message.

Definition at line 243 of file MetaAssertMacros.h.