AUnit
1.7.1
Unit testing framework for Arduino platforms inspired by ArduinoUnit and Google Test.
|
Various macros (test(), testF(), testing(), testingF(), externTest(), externTestF(), externTesting(), externTestingF()) are defined in this header. More...
#include <stdint.h>
#include <Arduino.h>
#include "Flash.h"
#include "FCString.h"
#include "TestOnce.h"
#include "TestAgain.h"
Go to the source code of this file.
Macros | |
#define | test(...) GET_TEST(__VA_ARGS__, TEST2, TEST1)(__VA_ARGS__) |
Macro to define a test that will be run only once. More... | |
#define | GET_TEST(_1, _2, NAME, ...) NAME |
#define | TEST1(name) |
#define | TEST2(suiteName, name) |
#define | testing(...) GET_TESTING(__VA_ARGS__, TESTING2, TESTING1)(__VA_ARGS__) |
Macro to define a test that will run repeatly upon each iteration of the global loop() method, stopping when the something calls Test::pass(), Test::fail() or Test::skip(). More... | |
#define | GET_TESTING(_1, _2, NAME, ...) NAME |
#define | TESTING1(name) |
#define | TESTING2(suiteName, name) |
#define | externTest(...) GET_EXTERN_TEST(__VA_ARGS__, EXTERN_TEST2, EXTERN_TEST1)(__VA_ARGS__) |
Create an extern reference to a test() test case object defined elsewhere. More... | |
#define | GET_EXTERN_TEST(_1, _2, NAME, ...) NAME |
#define | EXTERN_TEST1(name) |
#define | EXTERN_TEST2(suiteName, name) |
#define | externTesting(...) GET_EXTERN_TESTING(__VA_ARGS__, EXTERN_TESTING2, EXTERN_TESTING1)(__VA_ARGS__) |
Create an extern reference to a testing() test case object defined elsewhere. More... | |
#define | GET_EXTERN_TESTING(_1, _2, NAME, ...) NAME |
#define | EXTERN_TESTING1(name) |
#define | EXTERN_TESTING2(suiteName, name) |
#define | testF(testClass, name) |
Create a test that is derived from a custom TestOnce class. More... | |
#define | testingF(testClass, name) |
Create a test that is derived from a custom TestAgain class. More... | |
#define | externTestF(testClass, name) |
Create an extern reference to a testF() test case object defined elsewhere. More... | |
#define | externTestingF(testClass, name) |
Create an extern reference to a testingF() test case object defined elsewhere. More... | |
Various macros (test(), testF(), testing(), testingF(), externTest(), externTestF(), externTesting(), externTestingF()) are defined in this header.
Definition in file TestMacros.h.
#define EXTERN_TEST1 | ( | name | ) |
Definition at line 130 of file TestMacros.h.
#define EXTERN_TEST2 | ( | suiteName, | |
name | |||
) |
Definition at line 138 of file TestMacros.h.
#define EXTERN_TESTING1 | ( | name | ) |
Definition at line 160 of file TestMacros.h.
#define EXTERN_TESTING2 | ( | suiteName, | |
name | |||
) |
Definition at line 168 of file TestMacros.h.
#define externTest | ( | ... | ) | GET_EXTERN_TEST(__VA_ARGS__, EXTERN_TEST2, EXTERN_TEST1)(__VA_ARGS__) |
Create an extern reference to a test() test case object defined elsewhere.
This is only necessary if you use assertTestXxx() or checkTestXxx() when the test is in another file (or defined after the assertion on it).
Two versions are supported: externTest(name) and externTest(suiteName, name). The 2-argument externTest(suiteName, name) is a convenience macro which is identical to externTest(suiteName_name).
Definition at line 125 of file TestMacros.h.
#define externTestF | ( | testClass, | |
name | |||
) |
Create an extern reference to a testF() test case object defined elsewhere.
This is only necessary if you use assertTestXxx() or checkTestXxx() when the test is in another file (or defined after the assertion on it).
Definition at line 216 of file TestMacros.h.
#define externTesting | ( | ... | ) | GET_EXTERN_TESTING(__VA_ARGS__, EXTERN_TESTING2, EXTERN_TESTING1)(__VA_ARGS__) |
Create an extern reference to a testing() test case object defined elsewhere.
This is only necessary if you use assertTestXxx() or checkTestXxx() when the test is in another file (or defined after the assertion on it).
Two versions are supported: externTesting(name) and externTesting(suiteName, name).
Definition at line 155 of file TestMacros.h.
#define externTestingF | ( | testClass, | |
name | |||
) |
Create an extern reference to a testingF() test case object defined elsewhere.
This is only necessary if you use assertTestXxx() or checkTestXxx() when the test is in another file (or defined after the assertion on it).
Definition at line 230 of file TestMacros.h.
#define test | ( | ... | ) | GET_TEST(__VA_ARGS__, TEST2, TEST1)(__VA_ARGS__) |
Macro to define a test that will be run only once.
Two versions are supported: test(name) and test(suiteName, name). The 2-argument test(suiteName, name) is a convenience macro which is identical to test(suiteName_name).
Definition at line 53 of file TestMacros.h.
#define TEST1 | ( | name | ) |
Definition at line 58 of file TestMacros.h.
#define TEST2 | ( | suiteName, | |
name | |||
) |
Definition at line 69 of file TestMacros.h.
#define testF | ( | testClass, | |
name | |||
) |
Create a test that is derived from a custom TestOnce class.
The name of the instance is prefixed by '{testClass}_' to avoid name collisions with similarly named tests using other fixtures.
Definition at line 181 of file TestMacros.h.
#define testing | ( | ... | ) | GET_TESTING(__VA_ARGS__, TESTING2, TESTING1)(__VA_ARGS__) |
Macro to define a test that will run repeatly upon each iteration of the global loop() method, stopping when the something calls Test::pass(), Test::fail() or Test::skip().
Two versions are supported: testing(name) and testing(suiteName, name). The 2-argument testing(suiteName, name) is a convenience macro which is identical to testing(suiteName_name).
Definition at line 89 of file TestMacros.h.
#define TESTING1 | ( | name | ) |
Definition at line 94 of file TestMacros.h.
#define TESTING2 | ( | suiteName, | |
name | |||
) |
Definition at line 105 of file TestMacros.h.
#define testingF | ( | testClass, | |
name | |||
) |
Create a test that is derived from a custom TestAgain class.
The name of the instance is prefixed by '{testClass}_' to avoid name collisions with similarly named tests using other fixtures.
Note that test(suiteName, name) is different than testF(className, name), but there will be a name collision if suiteName is the same as className.
Definition at line 200 of file TestMacros.h.