25 #ifndef AUNIT_TEST_RUNNER_H 26 #define AUNIT_TEST_RUNNER_H 47 static void run() { getRunner()->runTest(); }
50 static void list() { getRunner()->listTests(); }
56 static void exclude(
const char* pattern) {
57 getRunner()->setLifeCycleMatchingPattern(
67 static void exclude(
const char* testClass,
const char* pattern) {
68 getRunner()->setLifeCycleMatchingPattern(testClass, pattern,
76 static void include(
const char* pattern) {
86 static void include(
const char* testClass,
const char* pattern) {
87 getRunner()->setLifeCycleMatchingPattern(testClass, pattern,
93 getRunner()->setVerbosityFlag(verbosity);
98 return getRunner()->isVerbosityFlag(verbosity);
111 getRunner()->setRunnerTimeout(seconds);
116 static const TimeoutType kTimeoutDefault = 10;
119 static const uint8_t kMaxPatternLength = 63 + 1;
125 static uint16_t countTests();
141 void printStartRunner()
const;
144 void resolveRun()
const;
150 void setVerbosityFlag(uint8_t verbosity) { mVerbosity = verbosity; }
153 bool isVerbosityFlag(uint8_t verbosity)
const {
154 return mVerbosity & verbosity;
158 void setLifeCycleMatchingPattern(
const char* pattern, uint8_t lifeCycle);
164 void setLifeCycleMatchingPattern(
const char* testClass,
const char* pattern,
168 void setRunnerTimeout(TimeoutType seconds);
180 uint16_t mPassedCount;
181 uint16_t mFailedCount;
182 uint16_t mSkippedCount;
183 uint16_t mExpiredCount;
184 uint16_t mStatusErrorCount;
185 TimeoutType mTimeout;
186 unsigned long mStartTime;
187 unsigned long mEndTime;
The class that runs the various test cases defined by the test() and testing() macros.
Base class of all test cases.
static void exclude(const char *pattern)
Exclude the tests which match the pattern.
static void setTimeout(TimeoutType seconds)
Set test runner timeout across all tests, in seconds.
static void include(const char *pattern)
Include the tests which match the pattern.
static void exclude(const char *testClass, const char *pattern)
Exclude the tests which match the pattern given by (testClass + "_" + pattern), the same concatenatio...
static void setVerbosity(uint8_t verbosity)
Set the verbosity flag.
uint8_t TimeoutType
Integer type of the timeout parameter.
static void run()
Run all tests using the current runner.
static const uint8_t kLifeCycleExcluded
Test is Excluded by an exclude() method.
static void list()
Print out the known tests.
static void setPrinter(Print *printer)
Set the output printer.
static const uint8_t kLifeCycleNew
Test is new, needs to be setup.
static void include(const char *testClass, const char *pattern)
Include the tests which match the pattern given by (testClass + "_" + pattern), the same concatenatio...
static bool isVerbosity(uint8_t verbosity)
Returns true if ANY of the bit flags of 'verbosity' is set.